I want to access the return statusCode as 200/401 etc.How can I do this?
var poster=$.post(url,
{nickname:name, email:mail},function(data) {
alert('Inside poster done');
});
alert(poster.statusCode);
poster.done(function(data){
alert(data);
});
I have tried the answer given in How do I get HTTP error response code in Jquery POST (xhr.status), and it simply returns 0.Thought the actual response is 401 which was shown in the web console.What's the right way of accessing the return status of the POST command?