Skip to content Skip to sidebar Skip to footer

Output REST API Status Displayed In Postman To AJAX

In Postman, I can successfully communicate with my REST API. I can put my API server in various artificial states to represent 2xx, 4xx & 5xx errors which I can successfully v

Solution 1:

You can get the returned status code from the status property of the jqXHR object:

.fail(function(jqXHR, textStatus, errorThrown) {
    console.log("Return Code: " + jqXHR.status);
});

Working example


Post a Comment for "Output REST API Status Displayed In Postman To AJAX"