The user must pass the json object as part of the request. It will look something like this:
{"token" :"ayaljltja", "addresses": [ {'name':'Home','address':'20 Main Street', 'city':'new-york'}, {'name':'work', 'address':'x Street', 'city':'ohio'} ]}
I have two problems right now. Firstly, I cannot figure out how to verify this code by re-creating the nested POST. I can successfully execute a POST dict, but posting a list of addresses in a JSON object is causing an error.
Just using cURL, how can I do this? How can I do this with urrlib2?
My second problem is deserializing the server side JSON POST object. I guess I just need to see a successful POST to determine the input (and then deserialize it using the json module).
Any tips?
source share