axios.post in node js code example
Example 1: install axios
npm install axios
Example 2: axios post
axios.post('/user', {
firstName: 'Fred',
lastName: 'Flintstone'
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
Example 3: axios library
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>