Answers for "how to pass express headers to axios"

6

how to send header in axios

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

Code answers related to "how to pass express headers to axios"

Code answers related to "Javascript"

Browse Popular Code Answers by Language