bulletproof-react icon indicating copy to clipboard operation
bulletproof-react copied to clipboard

Question: Is there any reason why global axios defaults shouldn't be used in api-client.ts?

Open cmacdonnacha opened this issue 6 months ago • 0 comments
trafficstars

As per title, I was curious if there's any reason why global axios defaults shouldn't be used in api-client.ts?

So instead of:

  if (config.headers) {
    config.headers.Accept = 'application/json';
  }

you'd have:

axios.defaults.headers.common.Accept = 'application/json';

cmacdonnacha avatar May 21 '25 11:05 cmacdonnacha