Closed zuisong closed 8 months ago
Having reviewed the history of the issue, I understand the reason why it happened. I am happy to implement a fix, if you have a fix in mind.
We copied this behavior from HTTPie, so I was surprised to see it different in your example. Apparently with --offline
it ignores --download
, these are the headers it sends in online mode:
GET / HTTP/1.1
Accept: */*
Accept-Encoding: identity
Connection: keep-alive
Host: localhost:8080
User-Agent: HTTPie/3.2.2
I feel like requesting a compressed response might possibly be okay if --continue
isn't used, but wget
and aria2c
don't do it automatically, so I'd first want to understand why (or to see another popular downloader that makes this decision).
wget
does have an opt-in --compression
option but it's marked experimental.
Yes, httpie also doesn't automatically request compressed response body in online mode. I misread it, this issue can be closed.
Currently I solved this problem by redirecting the response body to a file, without using the --download flag.
xh your.request.url > output.file
When using download mode, Httpie automatically requests the compressed response body, whereas xh doesn't. This means that xh will use more traffic to download the file.
xh:
httpie: