Skip to content
Myr

Merge pull request #1592 from homm/master

Before adoption: this commit came in with the history the project adopted, so no landing records it.

remove extra mention of dangerous `r.raw`

authored by Cory Benfield · committed by Cory Benfield · parents 917a15f, f0c592b · Browse files · 3 files+6 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+6 added−4 removed

  • other:+6 added−4 removed

3 files+6 added−4 removed

modified:docs/user/advanced.rst+1 added-1 removed
159 unmodified lines
160 if int(r.headers['content-length']) < TOO_LONG:161 content = r.content162 ...163164You 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`.164You 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`.165166167Keep-Alive168----------
426 unmodified lines
modified:docs/api.rst+4 added-3 removed
151 unmodified lines
152 ::153154 # in 0.x, passing prefetch=False would accomplish the same thing155 r = requests.get('https://github.com/timeline.json', stream=True)156 r.raw.read(10)156 for chunk in r.iter_content(8192):157 ...158159* The ``config`` parameter to the requests method has been removed. Some of160 these options are now configured on a ``Session`` such as keep-alive and161 maximum number of redirects. The verbosity option should be handled by
8 unmodified lines
170 # you will see the REQUEST, including HEADERS and DATA, and RESPONSE with HEADERS but without DATA.171 # the only thing missing will be the response.body which is not logged.172 import httplib173 httplib.HTTPConnection.debuglevel = 1173 174175 logging.basicConfig() # you need to initialize logging, otherwise you will not see anything from requests176 logging.getLogger().setLevel(logging.DEBUG)177 requests_log = logging.getLogger("requests.packages.urllib3")178 requests_log.setLevel(logging.DEBUG)179 requests_log.propagate = True179 180181 requests.get('http://httpbin.org/headers')182183184
11 unmodified lines
modified:AUTHORS.rst+1 added
132 unmodified lines
133- Kevin Burke <kev@inburke.com>134- Flavio Curella135- David Pursehouse <david.pursehouse@gmail.com> @dpursehouse136- Jon Parise137— Alexander Karpinsky @homm86