问题
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"
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"))
回答1:
This issue was discussed and resolved on GitHub:
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.
来源:https://stackoverflow.com/questions/38592065/httr-and-accept-encoding-gzip-deflate