Query Parameters don't pass lists literally #1596
-
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. |
Beta Was this translation helpful? Give feedback.
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 :) |
Beta Was this translation helpful? Give feedback.
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 :)