You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const axios = require('axios').default;
// Make a request for a user with a given ID
axios.get('/user?ID=12345')
.then(function (response) {
// handle success
console.log(response);
})
.catch(function (error) {
// handle error
console.log(error);
})
.then(function () {
// always executed
});
// Optionally the request above could also be done as
axios.get('/user', {
params: {
ID: 12345
}
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
})
.then(function () {
// always executed
});
Suggested Improvement
Identify what is confusing or incorrect and what could make it better
In accordance with correct syntax, get example should have .finally instead of .then
The text was updated successfully, but these errors were encountered:
Section/Content To Improve
Quote or link to section
https://axios-http.com/docs/example
Suggested Improvement
Identify what is confusing or incorrect and what could make it better
In accordance with correct syntax, get example should have .finally instead of .then
The text was updated successfully, but these errors were encountered: