I want to convert such query string:
a=1&b=2
to json string
{"a":1, "b":2}
Any existing solution?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Python 3+
Python 2:
In both cases the result is
This is actually better than your
{"a":1, "b":2}, because URL query strings can legally contain the same key multiple times, i.e. multiple values per key.