httr和Accept-Encoding:gzip,deflate [英] httr and Accept-Encoding: gzip, deflate
本文介绍了httr和Accept-Encoding:gzip,deflate的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在R中进行以下通话:
I want to do the following call in 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":
The line above returns a gzip compressed string. But when I use the httr R-package it seems that "Accept-Encoding: gzip, deflate" is ignored:
library(httr)
content = GET(url = "http://www.openml.org/api/v1/task/list/limit/3000?api_key=c1994bdb7ecb3c6f3c8f3b35f4b47f1f", add_headers(`Accept-Encoding` = "gzip, deflate"))
推荐答案
This issue was discussed and resolved on GitHub:
哈德利: 我很确定httr会为您解压缩它,因此您需要提供一些证据,证明传输本身没有被压缩.
hadley: I'm pretty sure httr just uncompresses it for you, so you'll need to provide some evidence that the transport itself is not compressed.
这篇关于httr和Accept-Encoding:gzip,deflate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文