cURL / Mailing Lists / curl-users / Single Mail

curl-users

Content-Encoding when not sending Accept-Encoding

From: Tom Grace <tom_at_deathbycomputers.co.uk>
Date: Mon, 21 Mar 2011 11:46:56 +0000

Hi,

I noticed that when using the Stack Overflow API, gzipped content is
always returned. The Content-Encoding: gzip header is returned, but Curl
(7.19.7) does not follow this header and returns gzipped data. Is this
expected behaviour ?

Example:
curl -v http://api.stackoverflow.com/1.1/answers | file -
* About to connect() to api.stackoverflow.com port 80 (#0)
* Trying 64.34.119.12... connected
* Connected to api.stackoverflow.com (64.34.119.12) port 80 (#0)
> GET /1.1/answers HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7
OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15
> Host: api.stackoverflow.com
> Accept: */*
>
< HTTP/1.1 200 OK
< Cache-Control: private
< Content-Type: application/json; charset=utf-8
< Content-Encoding: gzip
< X-AspNetMvc-Version: 3.0
< X-RateLimit-Max: 300
< X-RateLimit-Current: 296
< X-AspNet-Version: 4.0.30319
< Date: Mon, 21 Mar 2011 11:42:45 GMT
< Content-Length: 4004
<
{ [data not shown]
100 4004 100 4004 0 0 13138 0 --:--:-- --:--:-- --:--:--
37420* Connection #0 to host api.stackoverflow.com left intact

* Closing connection #0
/dev/stdin: gzip compressed data, from FAT filesystem (MS-DOS, OS/2,
NT), max speed

Tom
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-03-21