I have a http interceptor in my project, it handles the refreshing of the access token. When a user’s access token expires the request will get a 401 error, in that case, this function should handle …
Tag: interceptor
Axios catch not working when used with a customer interceptor
I am using interceptor that refreshes the access token upon a status code of 401 but my catch has stopped working upon any other error codes such as 400 request.js import axios from ‘axios’ const …
Intercept fetch() API requests and responses in JavaScript
I want to intercept fetch API requests and responses in JavaScript. For example, before sending the request I want to intercept the request URL. I’d like to intercept the response once it arrives as …