【问题标题】:Error in download.file unsupported URL schemedownload.file 中的错误不受支持的 URL 方案
【发布时间】:2015-07-17 04:33:01
【问题描述】:

我正在使用一种算法 R,它调用一个对数据库进行查询并返回 JSON 对象的 Web 服务。

url <- "https://example.com?id=1"
json_file <- "C:/xampp/htdocs/example/Download/data.json"
download.file(url, json_file)
document <- fromJSON(json_file)

在我的机器上,当我进入服务器并运行时,算法通常运行不佳,我收到以下错误:

Error in download.file(url, json_file) : unsupported URL scheme

url 是 https 有问题吗?

【问题讨论】:

    标签: json r web-services ubuntu


    【解决方案1】:

    来自?download.file的详细信息部分。

     Note that 'https://' URLs are only supported if '--internet2' or
     environment variable 'R_WIN_INTERNET2' was set or
     'setInternet2(TRUE)' was used (to make use of Internet Explorer
     internals), and then only if the certificate is considered to be
     valid.
    

    【讨论】:

    • @perondi 超级用户是解决此类问题的最佳场所。例如,请参阅superuser.com/q/184625
    • 顺便说一句,如果答案对您有用,那么您可以通过单击勾选旁边的向上箭头来投票。
    【解决方案2】:

    在 Ubuntu 中,你可以使用method = "curl" 来使用 curl 下载。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-08-03
      • 1970-01-01
      • 2021-10-12
      • 2015-05-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多