mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 06:46:15 +00:00
Update api.rst (#5877)
This commit is contained in:
+2
-2
@@ -127,7 +127,7 @@ API Changes
|
|||||||
::
|
::
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
r = requests.get('https://github.com/timeline.json')
|
r = requests.get('https://api.github.com/events')
|
||||||
r.json() # This *call* raises an exception if JSON decoding fails
|
r.json() # This *call* raises an exception if JSON decoding fails
|
||||||
|
|
||||||
* The ``Session`` API has changed. Sessions objects no longer take parameters.
|
* The ``Session`` API has changed. Sessions objects no longer take parameters.
|
||||||
@@ -156,7 +156,7 @@ API Changes
|
|||||||
::
|
::
|
||||||
|
|
||||||
# in 0.x, passing prefetch=False would accomplish the same thing
|
# in 0.x, passing prefetch=False would accomplish the same thing
|
||||||
r = requests.get('https://github.com/timeline.json', stream=True)
|
r = requests.get('https://api.github.com/events', stream=True)
|
||||||
for chunk in r.iter_content(8192):
|
for chunk in r.iter_content(8192):
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user