axios.default.header.put code example
Example 1: axios set authorization header
const username = ''
const password = ''
const token = Buffer.from(`${username}:${password}`, 'utf8').toString('base64')
const url = 'https://...'
axios.post(url, {
headers: {
'Authorization': `Basic ${token}`
}
})
Example 2: axios default headers authorization
axios.defaults.headers.common['Authorization'] = AUTH_TOKEN;