这是我的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类型的方式,我已经检查了标头。