1// Send a POST request
2axios({
3 method: 'post',
4 url: '/user/12345',
5 data: {
6 firstName: 'Fred',
7 lastName: 'Flintstone'
8 },
9 headers: {'Authorization': 'Bearer ...'}
10});
1axios.get('/foo')
2 .catch(function (error) {
3 if (error.response) {
4 console.log(error.response.data);
5 console.log(error.response.status);
6 console.log(error.response.headers);
7 }
8 });
1axios.get('/api/updatecart', {
2 params: {
3 product: this.product
4 }
5}).then(...)
6