From 6a8c1595e428c7f88aad6da5063c5b5a60deb2db Mon Sep 17 00:00:00 2001 From: Boris Verkhovskiy Date: Mon, 27 Feb 2023 16:31:15 +0100 Subject: [PATCH] Response.raw.read() returns bytes (#6365) --- docs/user/quickstart.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/user/quickstart.rst b/docs/user/quickstart.rst index 7fac5ce735..464e4f5fa5 100644 --- a/docs/user/quickstart.rst +++ b/docs/user/quickstart.rst @@ -177,7 +177,7 @@ server, you can access ``r.raw``. If you want to do this, make sure you set >>> 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:: @@ -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) { ...