RuntimeError when AsyncClient.put has binary request body. #2961
Replies: 5 comments
-
|
I did some debugging: |
Beta Was this translation helpful? Give feedback.
-
|
I do more tests.
|
Beta Was this translation helpful? Give feedback.
-
|
Any solution to this? |
Beta Was this translation helpful? Give feedback.
-
|
Ah, from the docs: https://www.python-httpx.org/async/ |
Beta Was this translation helpful? Give feedback.
-
|
After using aiofiles.open to replace the raw open function, there's no error. But I don't know how it‘s performs. Here's the code: import aiofiles
async with aiofiles.open("xxx.file", "rb") as f:
async with httpx.AsyncClinet() as client:
resp = await client.request("PUT", "url", data=f) |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When I wish to upload data using AsyncClient.put, it triggers an error telling me this is a synchronous request.
Demo
Error Info:
Maybe this is a BUG.
Beta Was this translation helpful? Give feedback.
All reactions