【问题标题】:httr and Accept-Encoding: gzip, deflatehttr 和 Accept-Encoding:gzip、deflate
【发布时间】:2016-07-26 14:03:31
【问题描述】:

我想在 R 中进行以下调用:

curl "http://www.openml.org/api/v1/task/list/limit/3000?api_key=c1994bdb7ecb3c6f3c8f3b35f4b47f1f" -H "Accept-Encoding: gzip, deflate"

上面的行返回一个 gzip 压缩字符串。但是当我使用 httr R-package 时,似乎“Accept-Encoding: gzip, deflate”被忽略了:

library(httr)
content = GET(url = "http://www.openml.org/api/v1/task/list/limit/3000?api_key=c1994bdb7ecb3c6f3c8f3b35f4b47f1f", add_headers(`Accept-Encoding` = "gzip, deflate"))

【问题讨论】:

    标签: r curl get rcurl httr


    【解决方案1】:

    这个问题已经讨论并解决on GitHub

    哈德利: 我很确定 httr 只是为你解压缩它,所以你需要提供一些证据证明传输本身没有被压缩。

    【讨论】:

      猜你喜欢
      • 2012-03-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-08
      • 2018-11-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多