Ajax请求返回200,但失败事件被触发而不是完成

时间:2019-12-13 07:14:45

标签: javascript jquery ajax api

这是我的ajax代码,我已将数据类型指定为JSON。我收到了代码为200的成功响应,但是我的ajax失败事件被触发了。

$.ajax({
    url: 'API URL',
    type: 'post',
    dataType: 'JSON',
    data: JSON.stringify(result)
}).done(function(response) {
    console.log(response);         
})
.fail(function(response) {
    console.log("error");
});

通过我收到的响应仅是JSON类型的方式,我已经检查了标头。

0 个答案:

没有答案