I want to intercept all the AJAX calls in my app and am planning to use the below
axios.interceptors.request.use(req => {
// `req` is the Axios request config, so you can modify
// the `headers`.
req.headers.someCustomHeader = 'XYZ';
return req;
});
So basically, I want to set some custom header on all requests going out. But since in my app, I also have used fetch calls, not sure if the above would intercept only axios calls OR also intercept fetch() calls ?