]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Do not recommend the deprecated `data=` kwarg for passing bytes. (#2044)
authorVytautas Liuolia <vytautas.liuolia@gmail.com>
Sun, 23 Jan 2022 20:37:27 +0000 (21:37 +0100)
committerGitHub <noreply@github.com>
Sun, 23 Jan 2022 20:37:27 +0000 (21:37 +0100)
(`data=` is meant for sending form data.)

docs/async.md

index 09d2940b15d464a205de10394a83bbe6ee63e420..8782cdea8fd1d3dda19fe167a57b283cf88e5b38 100644 (file)
@@ -109,7 +109,7 @@ When sending a streaming request body with an `AsyncClient` instance, you should
 async def upload_bytes():
     ...  # yield byte content
 
-await client.post(url, data=upload_bytes())
+await client.post(url, content=upload_bytes())
 ```
 
 ### Explicit transport instances