Consider the following:
(let ((url-inhibit-uncompression t))
(switch-to-buffer
(url-retrieve-synchronously
"http://api.stackexchange.com/2.2/filter/create")))
I would expect to get something that looks mostly like garbage as the content (gzipped response), but instead I get a 'reasonable' JSON object (formatted for sanity):
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: application/json; charset=utf-8
Content-Encoding: gzip
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST
Access-Control-Allow-Credentials: false
X-Content-Type-Options: nosniff
Date: Sat, 01 Nov 2014 03:19:40 GMT
Content-Length: 1903
{
"quota_remaining": 178,
"quota_max": 300,
"has_more": false,
"items": [
{
"filter": "default",
"filter_type": "safe",
"included_fields": [
".backoff",
".error_id",
".error_message",
.................
"write_permission.min_seconds_between_actions",
"write_permission.object_type",
"write_permission.user_id"
]
}
]
}
Why is url-inhibit-uncompression
not doing anything here? Spoiler alert: It's not used anywhere in the source (that I can find). How can I force output similar to curl
without using curl
(i.e. compressed and without headers)?