Merge pull request #1592 from homm/master
remove extra mention of dangerous `r.raw`
This commit is contained in:
@@ -134,3 +134,4 @@ Patches and Suggestions
|
||||
- Flavio Curella
|
||||
- David Pursehouse <david.pursehouse@gmail.com> @dpursehouse
|
||||
- Jon Parise
|
||||
— Alexander Karpinsky @homm86
|
||||
|
||||
@@ -153,7 +153,8 @@ API Changes
|
||||
|
||||
# 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)
|
||||
for chunk in r.iter_content(8192):
|
||||
...
|
||||
|
||||
* The ``config`` parameter to the requests method has been removed. Some of
|
||||
these options are now configured on a ``Session`` such as keep-alive and
|
||||
@@ -170,13 +171,13 @@ API Changes
|
||||
# the only thing missing will be the response.body which is not logged.
|
||||
import httplib
|
||||
httplib.HTTPConnection.debuglevel = 1
|
||||
|
||||
|
||||
logging.basicConfig() # you need to initialize logging, otherwise you will not see anything from requests
|
||||
logging.getLogger().setLevel(logging.DEBUG)
|
||||
requests_log = logging.getLogger("requests.packages.urllib3")
|
||||
requests_log.setLevel(logging.DEBUG)
|
||||
requests_log.propagate = True
|
||||
|
||||
|
||||
requests.get('http://httpbin.org/headers')
|
||||
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ At this point only the response headers have been downloaded and the connection
|
||||
content = r.content
|
||||
...
|
||||
|
||||
You can further control the workflow by use of the :class:`Response.iter_content` and :class:`Response.iter_lines` methods, or reading from the underlying urllib3 :class:`urllib3.HTTPResponse` at :class:`Response.raw`.
|
||||
You can further control the workflow by use of the :class:`Response.iter_content` and :class:`Response.iter_lines` methods. Alternatively, you can read the undecoded body from the underlying urllib3 :class:`urllib3.HTTPResponse` at :class:`Response.raw`.
|
||||
|
||||
|
||||
Keep-Alive
|
||||
|
||||
Reference in New Issue
Block a user