Sending form data values bytestring incorrectly encodes it's without first decoding it as string as requests does #2595
Unanswered
nambrosini-codes
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, first of all thank you for writing this lib and writing awesome migration docs comparing with requests. It was really helpful on our migration effort.
One part of our tests broke because for requests we sent form data this way
Internally,
requestsfirst decodes the bytestring with the default encoding and only then quotes the value so it can be included in the url.httpxdoes not implicitly decode so instead of the expected string to start with%3C(<) we getb%27%3C(b'<). That is, bothband'are quoted, which breaks the api call.Once we manually passed a string, it worked, so the problem might perfectly be on our side. In that case i think it deserves a place on https://www.python-httpx.org/compatibility/. It was not obvious by reading it at least for us
So the question would be:
Is it an api design choice? Or are we misusing the api?
We noticed a comment on the implementation that assumes at that point the input of the function will always be a
stringbut it might affect others using requests and wanting to migrate tohttpxSource
Beta Was this translation helpful? Give feedback.
All reactions