Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

axios timeout post example

//example of an axios post request with body and config object with timeout
//timeout is response (not request) timeout (in milliseconds)
axios.post('http://mysite.com/user', { name: 'John' }, { timeout: 2 })
  .then(response => {     console.log(response);  })
  .catch(error => {     console.log(error);  });
Source by blog.bitsrc.io #
 
PREVIOUS NEXT
Tagged: #axios #timeout #post
ADD COMMENT
Topic
Name
2+5 =