I have this web application where web services are hosted on the Amazon API Gateway and the client application is hosted on the cloudefront site. Services include CORS. For any error, such as http 500, 401, 403, I can get the http status from the jqxhr object using the property status. But it looks like for http status 413 I get status 0 in the code.
I also noticed that the status of http 413 can be obtained if the request is made with the server. But only for ajax cross-domain status 413 is accepted as status 0.
Is there a way to handle the 413 http status for ajax request for cross domain.
Just briefly consider the following code block, for http status 500, 401, exit the answer to the 500 or 401 callback. But for 413 it displays 0.
$.ajax({
url: 'URL to AWS API Gateway',
success: function(d){
console.log(d);
},
error: function(a){
console.log( a.status );
}
});