axious put code example
Example 1: Using axios send a GET request to the address:
axios.get('/user?ID=12345')
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
axios.get('/user', {
params: {
ID: 12345
}
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
Example 2: axios library
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
Example 3: axios put
const res = await axios.put('https://httpbin.org/put', { hello: 'world' });
res.data.headers['Content-Type'];