1axios({
2 method: 'post',
3 url: 'myurl',
4 data: bodyFormData,
5 headers: {'Content-Type': 'multipart/form-data' }
6 })
7 .then(function (response) {
8 //handle success
9 console.log(response);
10 })
11 .catch(function (response) {
12 //handle error
13 console.log(response);
14 });
1var body = {
2 userName: 'Fred',
3 userEmail: 'Flintstone@gmail.com'
4}
5
6axios({
7 method: 'post',
8 url: '/addUser',
9 data: body
10})
11.then(function (response) {
12 console.log(response);
13})
14.catch(function (error) {
15 console.log(error);
16});
17