Is there any way to get curl to decompress a response without sending the Accept headers in the request?

后端 未结 2 1206
谎友^
谎友^ 2020-12-24 00:17

Is there any way to get curl to decompress a response without sending the Accept-encoding headers in the request?

I\'m trying to debug an issue where the order of th

相关标签:
2条回答
  • 2020-12-24 00:52

    curl --compressed http://example.com requests gzipped-compressed data and uncompresses it before writing to disk.

    0 讨论(0)
  • 2020-12-24 01:04

    Probably the easiest thing to do is just use gunzip to do it:

    curl -sH 'Accept-encoding: gzip' http://example.com/ | gunzip -
    

    Or there's also --compressed, which curl will decompress (I believe) since it knows the response is compressed. But, not sure if that meets your needs.

    0 讨论(0)
提交回复
热议问题