diff options
| author | homm <homm86@gmail.com> | 2013-09-12 10:20:47 +0400 |
|---|---|---|
| committer | homm <homm86@gmail.com> | 2013-09-12 10:20:47 +0400 |
| commit | 10b6d7794573b8099d944a5acc00d3b316ef12bc (patch) | |
| tree | 142f4d9e2e92b25e09ab1ddffca0d0f17510e4d9 /docs/api.rst | |
| parent | 917a15f154c67e8330539fd32cb2604437e01920 (diff) | |
| download | python-requests-10b6d7794573b8099d944a5acc00d3b316ef12bc.tar.gz | |
remove extra mention of dangerous `r.raw`
Diffstat (limited to 'docs/api.rst')
| -rw-r--r-- | docs/api.rst | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/docs/api.rst b/docs/api.rst index a1c2cb99..12ae8a8a 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -147,13 +147,14 @@ API Changes * The parameter for streaming requests was changed from ``prefetch`` to ``stream`` and the logic was inverted. In addition, ``stream`` is now - required for raw response reading. + required for chunked response reading. :: # 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') |
