Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How can I get the status code from an http error in Axios?

axios.get('/foo')
  .catch(function (error) {
    if (error.response) {
      console.log(error.response.data);
      console.log(error.response.status);
      console.log(error.response.headers);
    }
  });
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #I #status #code #http #error
ADD COMMENT
Topic
Name
4+5 =