我一直在使用带有 ASP.NET 的 JayRock 框架来返回通过 javascript 使用的 JSON。一切正常,直到我将 $.ajax 调用从 GET 更改为 POST。在进行该更改后,我现在收到此错误。
{"id":null,"error":{"name":"JSONRPCError","message":"Missing value.","errors":[{"name":"JsonException","message":"Missing value."}]}}
这是我的javascript:
var tmp = '{ "assID": 52 }';
var tmpObj = $.parseJSON(tmp);
$.ajax
({
type: "POST",
url: '/jsonC.ashx/tester',
dataType: 'json',
data: tmpObj,
async: true,
contentType: 'application/json',
success: function (result) {
console.log(JSON.stringify(result));
}
})
有人有想法么?提前致谢。