我正在尝试使用 $.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);
}
});