axios defaults headers add bearer token code example
Example 1: axios default headers authorization
axios.defaults.headers.common['Authorization'] = AUTH_TOKEN;
Example 2: axios defaults headers common
// Send a POST request
axios({
method: 'post',
url: '/user/12345',
data: {
firstName: 'Fred',
lastName: 'Flintstone'
}
});