Replies: 1 comment
-
|
I just ran into this today myself switching over from requests with a "params" argument in GET requests. I did find this -> https://www.python-httpx.org/compatibility/#query-parameters Seems like it is a documented design choice as httpx aims to be mostly compatible but not a drop in replacement. I just made a payload filter to handle things: |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
I am working on migrating an HTTP library from
requeststohttpx. One of the differences I noticed (which matter for me in final implementation) is treatment ofNonevalues inparamsandheaders. Requests just does not send params if they haveNonevalue, whilehttpxsends query parameter but without value and raises exceptions for headers.What requests does seems more intuitive to me. Is this deliberate design decision and is it subject to change? I can handle it on my end, but it seems like something that should be part of
httpx.For headers
requestsdoes not sendNonevalues, whilehttpxfails withAttributeError: 'NoneType' object has no attribute 'encode'. IMO - at very least it should not fail.Example:
I think I saw discussion about overwriting client params in concrete request - this might be a solution to that as well (send
Nonefor concrete value).What do you think?
Beta Was this translation helpful? Give feedback.
All reactions