我正在尝试使用$ .ajax发布数据,但我收到失败消息400错误。以下是代码:
$.ajax({
url: "http://192.168.1.9:150/Service.svc/usrregistration",
type: "POST",
// data: '{"Firstname":' + Firstname + ',"LastName:"'+LastName+'}',
data: '{"Firstname":"rose"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
processdata: true,
success: function (msg) {
alert(msg);
alert('Registerd successfully');
},
error: function (msg) {
alert('Faild'+msg.status);
}
});
答案 0 :(得分:3)
这是我的博文:Create REST service with WCF and Consume using jQuery
使用WCF的REST服务和使用jQuery的消费通过发布你可以轻松地找出问题它只需2或3分钟的步行
<强>其他强>