axios.post('/user', { firstName: 'Fred', lastName: 'Flintstone' }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); });
const res = await axios.put('https://httpbin.org/put', { hello: 'world' }); res.data.headers['Content-Type']; // application/json;charset=utf-8
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>