在jquery ajax POST中获取400(错误请求)错误
Getting 400(bad request) error in jquery ajax POST
我正在尝试使用 jquery 发送 Ajax POST 请求,但我收到 400(错误请求)错误这是我的代码:
$.ajax({
url: "http://192.168.3.118:2244/api/Customer/PostTblCustomer",
type: "POST",
data: {"CustName":"naveen",
"Mobile": 9490429799,
"Email":"naveendodda848@gmail.com",
"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);
}
})
我是电话差距的新手,请纠正我上面的附加代码,谢谢
您可能需要字符串化数据
data: JSON.stringify({"CustName":"naveen",
"Mobile": 9490429799,
"Email":"naveendodda848@gmail.com",
"Address":"Hyderabad",
"Password":12345,
"PinCode": 50000,
"IsServiceProvider":"false",
"Is_Blocked":"false"}),
相关文章:
- 遇到400错误请求(Angular+WebAPI)的问题
- 向Yahoo Finance API发出JSONP请求时获得400错误请求
- 尝试发布大型JSON数据时出现错误请求错误
- AWS API网关返回400错误请求,但Postman工作正常
- AngularJS错误:请求的键的值不是对象.keys@[本地代码]
- 岗位http://localhost:3000/api/signup400(错误请求)
- 云蚁发布错误请求
- Django Ajax 调用返回 403 错误请求
- 仅在 IE 中使用 jQuery 发布数据时出现错误请求错误
- angularjs中的POST 400错误请求
- RegEx导致无限循环/错误-请求的实体太大
- 400错误请求仅使用AngularJs,与jQuery一起使用
- 在jquery ajax POST中获取400(错误请求)错误
- GET 400(错误请求)与 js 中的节点
- Jasmine - Ajax Spyon 错误请求
- Gmail API 返回 400 个带有批处理请求的错误请求
- 一个控制器中的多个路由会导致 400:错误请求
- 跨源资源错误:请求的资源上不存在“访问控制允许源”标头
- 将 png 图像从 JavaScript 传递到 PHP(错误:请求 URI 太大)
- ajax post 调用导致将数组发送到弹簧休息控制器时出现 400(错误请求)