Query Parameters don't pass lists literally #1596
Answered
by
johtso
ghost
asked this question in
Potential Issue
|
Apologies in advance if this is my error. An API I'm dealing with expects a list as a parameter argument, for example: Calling httpx.get("https://www.example.com/endpoint", params={'locale':'en_US', 'range': [0,999]})Unfortunately resolves to Am I doing something incorrectly or is this an issue? Thank you. |
Answered by
johtso
Apr 25, 2021
Replies: 1 comment 2 replies
|
HTTPX is just trying to be helpful and represent your list in the proper query parameter fashion, which is to declare the same key multiple times with each value. If you want to avoid this behaviour, just turn your list into a string in the format you want it to be transmitted in :) |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
HTTPX is just trying to be helpful and represent your list in the proper query parameter fashion, which is to declare the same key multiple times with each value.
If you want to avoid this behaviour, just turn your list into a string in the format you want it to be transmitted in :)