I am trying to pass a dict variable to a remote server using BaseHTTPRequestHandler, but using json.dumps()
, my server sees:
%7B%22ID%22%3A+%7B%22type%22%3A+%22title%22%2C+%22search%22%3A+%22test%22%7D%7D
instead of:
{id: {'type': 'title', 'search': 'test'}}
I have tried using data.decode("utf-8")
, but that is just giving me an error as the data is already a string. I know I'm probably encoding/decoding wrong, but is there any way of getting from what it is already returning into the json format?
Take a look at the
unquote_plus
function fromurllib.parse
module:It outputs