Discussion:
Content-encoding compressed output
(too old to reply)
Piotr Wójcik
2018-05-16 06:56:31 UTC
Permalink
Raw Message
Hello!

According to this discussion: https://github.com/curl/curl/issues/2422 , curl
will *sometimes* print a compressed file instead of what servers serve, and
user can do nothing about that. I see it a bug, as this makes curl unreliable.
Why is it like this? What about some flag to print uncompressed output?
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://cur
Daniel Stenberg
2018-05-16 11:47:34 UTC
Permalink
Raw Message
Post by Piotr Wójcik
According to this discussion: https://github.com/curl/curl/issues/2422 , curl
will *sometimes* print a compressed file instead of what servers serve, and
user can do nothing about that. I see it a bug, as this makes curl unreliable.
Why is it like this? What about some flag to print uncompressed output?
On the contrary, I'd say it is in fact making curl reliable. I'll elaborate:

curl shows you what it gets from the server. If that contents is compressed,
and you didn't tell curl to uncompress it, it will "show" you the compressed
content. It will reliably show you exactly what the server sent in its
response. That has always been one of the fundamental behaviors of curl: you
get what you ask for.

You can ask curl to uncompress received data "automatically" with the
--compressed option.

Browsers will (of course) uncompress such responses automatically and show the
uncompressed contents. But they serve a slightly different purpose and thus
work differently in cases like this.
--
/ daniel.haxx.se
Piotr Wójcik
2018-05-16 12:49:44 UTC
Permalink
Raw Message
Oh, I just misread documentation for --compressed option. With it, curl works as I want to.

Thanks!
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquett

Loading...