diff --git a/README.md b/README.md index 8c83949a5b..d1f94c8f77 100755 --- a/README.md +++ b/README.md @@ -56,10 +56,15 @@ Performing a `GET` request // 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 @@ -73,7 +78,10 @@ axios.get('/user', { }) .catch(function (error) { console.log(error); - }); + }) + .then(function () { + // always executed + }); // Want to use async/await? Add the `async` keyword to your outer function/method. async function getUser() {