这是我对运行正常的页面save.php
的AJAX POST请求。
function updateJson(jsonarr){
var convertedJson = JSON.stringify(jsonarr);
$.post('save.php', {data: convertedJson}, function(result){});
}
convertedJson为[{“name”:“test1”,“score”:“1”},{“name”:“test2”,“score”:“0”}]
当我尝试使用Postman(或其他REST客户端)以相同的主体发布到相同的页面时,我得到代码200,但请求没有通过。
我做错了什么?
必须使用x-www-form-urlencoded作为主体类型,“data”作为键,Json作为值。