I have a python dict
x = {'id': 123, 'data': {'param1': 'hello', 'param2': 'world'}}
I'm trying to get my form-data to be
id=123
data[param1]=hello
data[param2]=world
I cannot pass it as a json, because the API receiving it won't accept json objects
I've tried passing it like this
requests.post(url, data=x, headers={'content-type': 'application/x-www-form-urlencoded'})
The request goes out with form data looking like this
id=123
data=param1
data=param2
Is there a way to get around this?