I'm forming a post request.
mydict = {'key1': 'value@1', 'key2': 'value@2'}
encoded_dict = urllib.urlencode(mydict)
This will result into
key1=value%401&key2=value%402
What I really want is
key1=value@1&key2=value@2
Any other way to this?
If you want to do your own thing, you'll have to write your own encoder. eg:
mydict = {'key1': 'value@1', 'key2': 'value@2'}
>>> "&".join("{}={}".format(*i) for i in mydict.items())
'key2=value@2&key1=value@1'
But why not just use JSON?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With