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
It would be nice to have an option to modify the api (the instance or request) dynamically. The close examples are interceptor or middleware. The closest case is to add a global header for each request without modifying the get method or use the 3rd argument.
I think 5.0.0 changed the Axios usage (or somewhere in 2018) to fully expose it - so the following was possible:
constapi=newKitsu()api.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 datareturnresponse;},function(error){// Any status codes that falls outside the range of 2xx cause this function to trigger// Do something with response errorreturnPromise.reject(error);});
PR above will also add it as an alias for it directly on the class (api.interceptors) when its merged.
It would be nice to have an option to modify the
api
(the instance or request) dynamically. The close examples areinterceptor
ormiddleware
. The closest case is to add a global header for each request without modifying theget
method or use the 3rd argument.ie:
The text was updated successfully, but these errors were encountered: