authorization header set in axios code example
Example 1: add authorization header axios
// Send a GET request with the authorization header set to
// the string 'my secret token'
const res = await axios.get('https://httpbin.org/get', {
headers: {
'Authorization': 'my secret token'
}
});
Example 2: axios default headers authorization
axios.defaults.headers.common['Authorization'] = AUTH_TOKEN;