Answers for "axios typescript set authorization header default"

6

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}`
  }
})
Posted by: Guest on April-21-2020
1

axios default headers authorization

axios.defaults.headers.common['Authorization'] = AUTH_TOKEN;
Posted by: Guest on September-29-2020

Code answers related to "axios typescript set authorization header default"

Code answers related to "Javascript"

Browse Popular Code Answers by Language