I am trying to call api through ajax call by simply doing
$.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) {
}
});
and got the simple json response like {"reference_id": 4231709, "success": "yes", "awb": [851001207, 851001208]}
thats the valid json response what i need, but still browser shows me an error(error function is getting called instead of success function ), i tried test the error but response text shows blank