mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Logic on streaming responses was changed in 1.0
* prefetch=False in 0.x is now stream=True
This commit is contained in:
+3
-3
@@ -142,12 +142,12 @@ API Changes
|
||||
.. _requests-kerberos: https://github.com/requests/requests-kerberos
|
||||
|
||||
* The parameter for streaming requests was changed from ``prefetch`` to
|
||||
``stream``. In addition, the stream parameter is required for raw response
|
||||
reading.
|
||||
``stream`` and the logic was inverted. In addition, ``stream`` is now
|
||||
required for raw response reading.
|
||||
|
||||
::
|
||||
|
||||
# in 0.x, the "stream" parameter was called "prefetch"
|
||||
# in 0.x, passing prefetch=False would accomplish the same thing
|
||||
r = requests.get('https://github.com/timeline.json', stream=True)
|
||||
r.raw.read(10)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user