Skip to content
Myr

Merge pull request #987 from Lukasa/master

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

Update docs to reflect correct use of raw.

authored by Kenneth Reitz · committed by Kenneth Reitz · parents f2820ee, 93b2be4 · Browse files · 2 files+6 added−3 removed
This commit

State

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

Diff stats

2 files+6 added−3 removed

  • other:+6 added−3 removed

2 files+6 added−3 removed

modified:docs/user/quickstart.rst+4 added-3 removed
135 unmodified lines
136137Raw Response Content138--------------------139140In the rare case that you'd like to get the absolute raw socket response from the server,141you can access ``r.raw``::140In the rare case that you'd like to get the raw socket response from the141server, you can access ``r.raw``. If you want to do this, make sure you set142``prefetch=False`` in your initial request. Once you do, you can do this::143144 >>> r = requests.get('https:/github.com/timeline.json', prefetch=False)145 >>> r.raw146 <requests.packages.urllib3.response.HTTPResponse object at 0x101194810>145147 >>> r.raw.read(10)148 '\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03'149150
345 unmodified lines
modified:requests/models.py+2 added
698 unmodified lines
699 #: value of a ``'Content-Encoding'`` response header.700 self.headers = CaseInsensitiveDict()701702 #: File-like object representation of response (for advanced usage).703 #: Requires that ``prefetch=False` on the request.704 # This requirement does not apply for use internally to Requests.705 self.raw = None706707 #: Final URL location of Response.708 self.url = None
213 unmodified lines