【发布时间】:2012-10-10 13:06:26
【问题描述】:
这里是jquery
$.ajax({
type: "POST",
url: "/posthere",
dataType: "json",
data: {myDict:{'1':'1', '2':'2'}},
success: function(data){
//do code
}
});
这是蟒蛇
@route("/posthere", method="POST")
def postResource(myDict):
#do code
return "something"
看起来支持 int、float、path 和 re 的 url 格式……我错过了什么吗?
【问题讨论】:
-
dataType指定 return 类型,而不是传递的数据类型。 -
...和
data需要是单级对象(哈希表),而不是分层的。 Reference.