我试图通过ajax调用来调用api,只需执行
$.ajax({
type: "POST",// GET in place of POST
url: 'http://api.ecomexpress.in/apiv2/fetch_awb/',
data : ({username: "",password: "",count: 2,type: 'COD'}),
success: function (result) {
window.alert("success!!");
},
error: function (xhr, ajaxOptions, thrownError) {
}
});
得到了像{"reference_id": 4231709, "success": "yes", "awb": [851001207, 851001208]}
那是有效的json响应我需要的,但仍然浏览器显示错误(错误函数被调用而不是成功函数),我试过测试错误但响应文本显示空白