【问题标题】:RCurl::getURL works, httr::GET has Failure when receiving data from the peerRCurl::getURL 有效,httr::GET 从对端接收数据时失败
【发布时间】:2019-01-03 23:38:18
【问题描述】:

我正在构建一些函数来从需要基本身份验证的网站(在本例中为 Workday)提取 csv 文件。我注意到 httr 没有按预期执行

当我使用以下内容时,

httr::GET('https://wd5-services1.myworkday.com/ccx/service/')

我收到此错误

Error in curl::curl_fetch_memory(url, handle = handle) : 
  Failure when receiving data from the peer

当我使用时

RCurl::getURL('https://wd5-services1.myworkday.com/ccx/service/') 

我得到以下结果(这是我想要的结果!)

[1] "500 : Invalid request"

我的问题是为什么 httr 出错,当 RCurl(和 cmd line curl 也是)返回正确的 http 错误时?

【问题讨论】:

  • 更新。看起来 Worday 更新了他们的 SSL 证书。当我现在使用RCurl::getURL() 时,我得到了error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure,但是当我使用httr::GET() 时,我现在得到了正确的结果。所以curl_fetch_memory() 错误一定与 SSL 密码有关。我只是不知道是什么。

标签: r httr geturl workday-api


【解决方案1】:

对我来说httr:GET 工作正常。无论如何,您可以在 github 上提交错误:https://github.com/r-lib/httr。请务必提供操作系统等其他信息。

httr::GET('https://wd5-services1.myworkday.com/ccx/service/')
#> Response [https://wd5-services1.myworkday.com/ccx/service/]
#>   Date: 2018-09-23 11:09
#>   Status: 500
#>   Content-Type: text/plain
#>   Size: 21 B

reprex package (v0.2.1) 于 2018 年 9 月 23 日创建

【讨论】:

猜你喜欢
  • 2021-08-20
  • 2018-12-18
  • 1970-01-01
  • 1970-01-01
  • 2020-12-24
  • 1970-01-01
  • 2014-06-20
  • 2015-10-08
  • 1970-01-01
相关资源
最近更新 更多