Skip to content
Myr

Response.raw.read() returns bytes (#6365)

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

authored by Boris Verkhovskiy · committed by GitHub · parent 1558590 · Browse files · 1 file+2 added−2 removed
This commit

State

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

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:docs/user/quickstart.rst+2 added-2 removed
175 unmodified lines
176 >>> r.raw177 <urllib3.response.HTTPResponse object at 0x101194810>178179 >>> r.raw.read(10)180 '\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03'180 b'\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03'181182In general, however, you should use a pattern like this to save what is being183streamed to a file::184
51 unmodified lines
236dictionary of data will automatically be form-encoded when the request is made::237238 >>> payload = {'key1': 'value1', 'key2': 'value2'}239240 >>> r = requests.post("https://httpbin.org/post", data=payload)240 >>> r = requests.post('https://httpbin.org/post', data=payload)241 >>> print(r.text)242 {243 ...244 "form": {
327 unmodified lines