Closed devashish2203 closed 1 year ago
I'm fairly certain there are many bugs about this on requests and a few here. There is no one right way to handle lists are from lists if a single item. Different server implementations have different expectations. In those cases the user knows what's best and must figure this out themselves
Thanks for the comment. So as per https://github.com/requests/toolbelt/issues/190#issuecomment-319900108 the solution is to send a list of tuples instead of a dict for this use case.
Formdata urlencode does not handle values as strings in the dictionary being encoded
Steps to Reproduce
The last line above throws the following exception
Expected Output:
a%5Bb%5D%5B%5D=abc
If there were multiple values in the list a%5Bb%5D%5B%5D=abc&a%5Bb%5D%5B%5D=def