here is the jquery
$.ajax({
type: "POST",
url: "/posthere",
dataType: "json",
data: {myDict:{'1':'1', '2':'2'}},
success: function(data){
//do code
}
});
Here is the python
@route("/posthere", method="POST")
def postResource(myDict):
#do code
return "something"
It looks like the the url formats on support int, float, path, and re… am I missing something?
There are only bytes on the wire. To send an object you need to serialize it using some data format e.g., json:
On the receiving end you need to parse json text into Python object:
Returned dictionaries are automatically converted to json.