deactivate automatic gzip decompression ?

I had some trouble to download a tar.gz file from a file server with a http interface, because I was not aware of the automatic decompression feature. Would it be possible to add an extra parameter which switches this feature off ? 


Thanks for raising this issue!

Quickly, before I dive into this: the correct solution when Requests is getting in your way like this is to use `Response.raw`. =) 

Before we get into discussing this feature request further, I'm interested to know how this problem bit you. We should only decompress the file if the file is served with a `Content-Encoding` header set to `gzip`. My best guess is that a `.tar.gz` file should be served with no `Content-Encoding` header and `Content-Type: x-gzip`. Do we know if this is a common behaviour with gzipped raw files, or if this was an unusual behaviour from your webserver? /cc @sigmavirus24 


I wrote the webserver myself using bottle, and bottle sets the `Content-Encoding` header to `gzip` automatically, so it was my fault to blame `requests` and I should further investigate what bottle is doing.


Well it may not be persuasive enough but _python.org_ is doing this: try downloading [http://www.python.org/ftp/python/3.4.0/Python-3.4.0b2.tgz](http://www.python.org/ftp/python/3.4.0/Python-3.4.0b2.tgz) with Requests, and actually you get `Python-3.4.0b2.tar` with ~4x size of its `content-length` :(


Once again, when downloading files that are `gzipped` and you want to keep the compression, you should read directly from `r.raw()`.

I'd argue that strictly python.org should be serving that file with no Content-Encoding and a Content-Type of application/x-gzip, but that's just me.


@yydonny why wouldn't you use streaming on a file like that anyway? Or are you just trying to argue a point? Passing `stream=True` will not decompress the file for you unless you use `iter_content` (or `iter_lines`). @Lukasa is 100% correct that you should be using the response's `raw` method. It is documented and it was the prior conclusion of this issue. For 98% of our users, the decompression is exactly what they want. For the 2% use case we have built in considerations but those users need to be considerate enough to read the documentation first.

Arguing that we should abandon what we're doing because there are servers that do the wrong thing on the web is like saying certain countries should start devaluing its currency because other nations do the same thing. That approach to economic "development" is as harmful to the citizens as deactivating automatic gzip decompression would be to the 98% of our users.


> @yydonny why wouldn't you use streaming on a file like that anyway? Or are you just trying to argue a point? Passing `stream=True` will not decompress the file for you unless you use `iter_content` (or `iter_lines`). @Lukasa is 100% correct that you should be using the response's `raw` method. It is documented and it was the prior conclusion of this issue. For 98% of our users, the decompression is exactly what they want. For the 2% use case we have built in considerations but those users need to be considerate enough to read the documentation first.
> 
> Arguing that we should abandon what we're doing because there are servers that do the wrong thing on the web is like saying certain countries should start devaluing its currency because other nations do the same thing. That approach to economic "development" is as harmful to the citizens as deactivating automatic gzip decompression would be to the 98% of our users.

Not to abandon automatic decompressing, but to introduce the option to disable it (by default the decompression should be enabled, of course). I have gzipped `StreamingHttpResponse` with `response.iter_content()` over it, trying to figure out how to not have it decompressed by `requests`.

This issue is over 7 years old and has a solution. Reviving it is not productive. Further, the library is in a rather strict feature-freeze so adding a new API where there's already a solution is not going to happen