Open shc261392 opened 1 year ago
Setting force_include_body=True
resolved the issue for me, but this looks more like a workaround.
auth = OAuth1Auth(
client_id=CONSUMER_KEY,
client_secret=CONSUMER_SECRET,
token=oauth_token,
token_secret=oauth_token_secret,
force_include_body=True)
Describe the bug
When sending files in a POST request using httpx client, all binary data (the files) are lost.
Error Stacks
There is no error stack for this issue, since this is an issue only detectable from server-side or only when the server side returns meaningful error responses. To demonstrate the case, I've added the full steps and scripts to reproduce the issue in the next section.
To Reproduce
Scripts for issue reproduction:
Steps to reproduce:
requests client
httpx client
It's obvious the binary data are lost when using httpx client.
Expected behavior
The request data should not be corrupted. httpx client should behaves like requests client when using the same inputs and configurations.
Environment:
Additional context
I've tried to fix this issue and the fix seems working. Perhaps I could submit a pull request if this issue could be verified true.