提交 d74238e1 编写于 作者: G Guillaume Briday 提交者: Justin Beckwith

Adding second then on axios call (#1623)

Inspired by this issue : https://github.com/axios/axios/issues/792#issuecomment-289306590
上级 405fe690
......@@ -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() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册