我試圖使用jQuery發送Ajax的POST請求,但我得到400(錯誤請求)錯誤 這裏是我的代碼:入門jQuery的AJAX POST 400(錯誤請求)錯誤
$.ajax({
url: "http://192.168.3.118:2244/api/Customer/PostTblCustomer",
type: "POST",
data: {"CustName":"naveen",
"Mobile": 9490429799,
"Email":"[email protected]",
"Address":"Hyderabad",
"Password":12345,
"PinCode": 50000,
"IsServiceProvider":"false",
"Is_Blocked":"false"},
dataType: "json",
contentType:"application/json",
success: function(data){
alert("success");
alert(data);
console.log(data);
},
error: function (xhr, ajaxOptions, thrownError) {
alert(xhr.status);
alert("error");
alert(thrownError);
console.log(xhr.status)
console.log(thrownError);
console.log(ajaxOptions);
}
})
我新手機的差距歡迎指正在adavance
呼叫可與郵遞員或其他Ajax工具附代碼謝謝上面?該錯誤是在真實設備還是模擬器/瀏覽器中顯示的? – Del