mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
Update response interceptor docs (#2399)
This commit is contained in:
committed by
Felipe Martins
parent
6a4a85c57f
commit
f5704fce71
@@ -492,9 +492,11 @@ axios.interceptors.request.use(function (config) {
|
|||||||
|
|
||||||
// Add a response interceptor
|
// Add a response interceptor
|
||||||
axios.interceptors.response.use(function (response) {
|
axios.interceptors.response.use(function (response) {
|
||||||
|
// Any status code that lie within the range of 2xx cause this function to trigger
|
||||||
// Do something with response data
|
// Do something with response data
|
||||||
return response;
|
return response;
|
||||||
}, function (error) {
|
}, function (error) {
|
||||||
|
// Any status codes that falls outside the range of 2xx cause this function to trigger
|
||||||
// Do something with response error
|
// Do something with response error
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user