Skip to content

Commit

Permalink
Response.raw.read() returns bytes (#6365)
Browse files Browse the repository at this point in the history
  • Loading branch information
verhovsky committed Feb 27, 2023
1 parent 1558590 commit 4618825
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/user/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ server, you can access ``r.raw``. If you want to do this, make sure you set
<urllib3.response.HTTPResponse object at 0x101194810>

>>> r.raw.read(10)
'\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03'
b'\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03'

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

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

>>> r = requests.post("https://httpbin.org/post", data=payload)
>>> r = requests.post('https://httpbin.org/post', data=payload)
>>> print(r.text)
{
...
Expand Down

0 comments on commit 4618825

Please sign in to comment.