-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Accept-Encoding: gzip, deflate" header is ignored? #387
Comments
How can you tell that the returned body is not compressed? |
Short explanation:Without the res1 = GET(url = "http://www.openml.org/api/v1/task/list/limit/1?api_key=c1994bdb7ecb3c6f3c8f3b35f4b47f1f",
add_headers(`Accept-Encoding` = "gzip, deflate"))
res2 = GET(url = "http://www.openml.org/api/v1/task/list/limit/1?api_key=c1994bdb7ecb3c6f3c8f3b35f4b47f1f")
# I would expect that res1$content contains the compressed xml and res2$content the uncompressed xml, but:
identical(res1$content, res2$content)
# TRUE
rawToChar(res2$content)
Works with CURL:
Result:
(this is basically the same content as from
Result (gzip compressed):
Is this enough as minimal example? |
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. |
You are absolutely right. I tested it with a network sniffer; the received file is compressed. Thx. I'll close. |
I am using httr for an api call in my package and I want to do the following call in R using httr:
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 because the returned body is not compressed :
The text was updated successfully, but these errors were encountered: