How does one set global headers in axios?
<p>Hi I'm setting default axios headers in request interceptor but these headers are not accessible in another function... in axios <a href="https://github.com/mzabriskie/axios#global-axios-defaults" rel="noreferrer">axios documentation</a> it is mentioned that global-axios-defaults are global...below is my sample code need help</p>

<pre><code>axios.interceptors.request.use(function (config) {
  axios.defaults.headers.accesstoken= "some_access_token"
  axios.defaults.headers.client = "some_client"
  axios.defaults.headers.uid = "some_uid"
  return config;
},function (error) {
  return Promise.reject(error);
});
</code></pre>

<p>On page load componentDidmount executes but axios default headers are undefined in this function</p>

<pre><code>componentDidMount: function() {
  console.log(axios.defaults.headers) #its giving me undefined
  axios.get("http://some_url_for_get_request.json", {
    headers: {
      accesstoken: axios.defaults.headers.accesstoken,
       uid: axios.defaults.headers.uid,
       client: axios.defaults.headers.client
    }
  })
}
</code></pre>