Answers for "axios send post data"

9

axios send post data

// Send a POST request
axios({
  method: 'post',
  url: '/user/12345',
  data: {
    firstName: 'Fred',
    lastName: 'Flintstone'
  },
  headers: {'Authorization': 'Bearer ...'}
});
Posted by: Guest on April-13-2020
2

axios get status code

axios.get('/foo')
  .catch(function (error) {
    if (error.response) {
      console.log(error.response.data);
      console.log(error.response.status);
      console.log(error.response.headers);
    }
  });
Posted by: Guest on September-20-2020
0

axios send payload in get request

axios.get('/api/updatecart', {
  params: {
    product: this.product
  }
}).then(...)
Posted by: Guest on August-09-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language