New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
httpx is deleting url query parameters that do not explicitly specify a value #2331
Comments
Good afternoon! This case reproduce in |
To determine if your assessment here is correct, try the same example but with |
@tomchristie you're right if use key-value pair in url, it's work. But what to do in case of query param without value (only key). In this discussion I found the opinion, that query can contain query param wiithout value |
It works fine? That isn't related to the bug I'm reporting however. Have you tried running my example? Url parameters that do not have an explicit value are being deleted. |
Great, so we've determined that your assessment is correct. This is specifically occurring for parameters without a value. So, yes, that looks broken to me. Confirmed this to myself with... import httpx
r = httpx.get("https://httpbin.org/get?foobar", params={'hello': "world"})
print(r.request.url) # https://httpbin.org/get?hello=world
r = httpx.get("https://httpbin.org/get?foobar=abc", params={'hello': "world"})
print(r.request.url) # https://httpbin.org/get?foobar=abc&hello=world |
The following program
should print
https://httpbin.org/get?hello=world&foobar
However, the actual output is
https://httpbin.org/get?hello=world
It appears that httpx is deleting url query parameters that do not explicitly specify a value.
Thanks for having a look
The text was updated successfully, but these errors were encountered: