0
這裏是我的Ajax調用請求數據,以Ajax調用轉換爲JS對象
$.ajax({
url:'http://localhost:8081/organizations/',
data: JSON.stringify({"name":"karthik"}),
type: 'POST',
dataType :'json',
processData : true,
success: (function(response){ alert("response "+response);}),
error: (function(err){ console.log(err); })
});
在API中,當我試圖打印request.data,爲什麼我收到這樣{u'{"name":"karthik"}': [u'']}
閱讀此問題應該可以幫到你。 http://stackoverflow.com/questions/17785592/difference-between-json-stringify-and-json-parse –