Home > front end >  The jquery ajax increase headers return status after 404
The jquery ajax increase headers return status after 404

Time:02-24

 
//the jQuery post method
The function scPostExt (url, data, the callback, async, type, dataType) {
if (! Type) {
Type="post".
}
if (! DataType) {
DataType="json";
}

if (! Async | | async==null | | typeof (async)=="undefined") {
Async=true;
}

$. Ajax ({
Url: globalData apiUrl + url,
Type: type,
DataType: dataType,
Data: data,
Async: async,
Headers: {
'token', '3333333'
},
Success: callback,
Error: function (XHR, textStatus errorThrown) {
The console. The log (" enter the error - ");
The console. The log (" status code: "+ XHR. Status);
The console. The log (" : "+ XHR. ReadyState);//the current state, 0 - an uninitialized, 1 - loading, 2 - has been loaded, 3 - data interaction, 4 -,
The console. The log (" error message: "+ XHR. StatusText);
The console. The log (" returns a response message: "+ XHR. The responseText);//here is the detailed information
The console. The log (" state of the request: "+ textStatus);
The console. The log (errorThrown);
The console. The log (" attempt failed ");
}
});
}

Status code: 404
4:
Error message: error
Returns a response message: undefined

After deleting headers can normal request
  • Related