Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/user/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,17 @@ Alternatively, you can read the undecoded body from the underlying
urllib3 :class:`urllib3.HTTPResponse <urllib3.response.HTTPResponse>` at
:attr:`Response.raw <requests.Response.raw>`.

.. note::

When using ``stream=True``, Requests does not automatically decompress
responses with ``Content-Encoding: gzip`` when accessing
:attr:`Response.raw <requests.Response.raw>`. This is intentional.

If you need decompression while streaming, enable it manually::

r = requests.get(url, stream=True)
r.raw.decode_content = True

If you set ``stream`` to ``True`` when making a request, Requests cannot
release the connection back to the pool unless you consume all the data or call
:meth:`Response.close <requests.Response.close>`. This can lead to
Expand Down