Skip to content

Commit 4618825

Browse files
authored
Response.raw.read() returns bytes (#6365)
1 parent 1558590 commit 4618825

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/user/quickstart.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ server, you can access ``r.raw``. If you want to do this, make sure you set
177177
<urllib3.response.HTTPResponse object at 0x101194810>
178178

179179
>>> 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'
181181

182182
In general, however, you should use a pattern like this to save what is being
183183
streamed to a file::
@@ -237,7 +237,7 @@ dictionary of data will automatically be form-encoded when the request is made::
237237

238238
>>> payload = {'key1': 'value1', 'key2': 'value2'}
239239

240-
>>> r = requests.post("https://httpbin.org/post", data=payload)
240+
>>> r = requests.post('https://httpbin.org/post', data=payload)
241241
>>> print(r.text)
242242
{
243243
...

0 commit comments

Comments
 (0)