我正在尝试从我公司的内部网共享点读取数据。
require(httr)
url <- "http://<domain>/<path>/_vti_bin/ListData.svc/<something>"
r <- GET(url)
问题是,对 Sharepoint 的访问使用 Windows 身份验证。预期以上内容给了我 401 Unauthorized 错误。
如何将我的 Windows 身份验证合并到 R 中的请求中,而无需在
GET
中以明文形式输入我的凭据范围? (使用 authenticate()
和我的凭据确实有效)。
最佳答案
authenticate()
是要使用的正确函数,但您需要更改输入,如下所示:
require(httr)
url <- "http://<domain>/<path>/_vti_bin/ListData.svc/<something>"
r <- GET(url, authenticate("username","password",type="any"))
我不确定哪种特定类型有效,但我能够使用 any 建立 session 。我在 httr 包文档中找到了解决方案。
https://cran.r-project.org/web/packages/httr/httr.pdf
关于r - 使用 Windows 身份验证访问 R 中的共享点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30091833/