提交 fa5ce95f 编写于 作者: M Matt Zabriskie 提交者: GitHub

Merge pull request #407 from axelboc/patch-2

Fixing doc on accessing response with then/catch
......@@ -322,7 +322,7 @@ The response for a request contains the following information.
}
```
When using `then` or `catch`, you will receive the response as follows:
When using `then`, you will receive the response as follows:
```js
axios.get('/user/12345')
......@@ -332,9 +332,11 @@ axios.get('/user/12345')
console.log(response.statusText);
console.log(response.headers);
console.log(response.config);
});
});
```
When using `catch`, or passing a [rejection callback](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) as second parameter of `then`, the response will be available through the `error` object as explained in the [Handling Errors](#handling-errors) section.
## Config Defaults
You can specify config defaults that will be applied to every request.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册