【发布时间】:2017-08-14 09:26:27
【问题描述】:
我正在尝试使用 R 通过 httr GET 访问我们组织中的网页。
但是我收到一条消息“由于凭据无效而拒绝访问”。 我可以手动执行所需的操作。 当我使用 Internet Explorer 访问该网站时,似乎授权是自动完成的,但是在尝试通过 R 执行相同操作时访问被阻止。
这就是我正在尝试的方式: (我无法提供确切的地址,因为它是一个内部网地址,只能在组织内部使用,与代理地址相同)
library(httr)
r <- GET(myurl, useproxy(myproxyid, 80), verbose())
-> GET http: //myurl
-> host: xxx
-> User-Agent : libcurl...
-> Accept-Encoding: gzip, deflate
-> Proxy-Connection: Keep-Alive
-> Accept: application/json, text/xml, application/xml, *.*
<- HTTP/1.1 401 Unauthorized
<- Content-Type: text/html
<- Server: Microsoft-IIS/8.5
<- WWW-Authenticate: Negotiate
<- WWW-Authenticate: NTLM
<- X-Powered-By: ASP.NET
r
Response [myurl]
Date
Status: 401
...
<title>401 - Unauthorized: Access is denied due to invalid credentials.</title>
....
我知道我必须以某种方式将我的凭据与我的请求一起发送。 是否有可能以某种方式使用自动身份验证?
谢谢 拉斐尔
【问题讨论】: