// ES6 --------------------- Module
import axios from 'axios' || const axios = require('axios')
// options are method, url, header, body
const options = {
method: '', // ......
url:'my-url.com',
header: {
js:object
},
// body isn't always required but here it would be
data:data
};
axios(options)
.then(function (response) {
console.log(response.data);
})
.catch(function (error) {
console.error(error);
});