Answers for "how to ask for token in header axios"

7

axios bearer token

{
    headers: {
      'Authorization': 'Bearer ' + validToken()
    }
 }
Posted by: Guest on December-20-2020
1

send token in axios header

const username = ''
const password = ''

const token = Buffer.from(`${username}:${password}`, 'utf8').toString('base64')

const url = 'https://...'
const data = {
  ...
}

axios.post(url, data, {
  headers: {
    'Authorization': `Basic ${token}`
  },
})
Posted by: Guest on August-13-2020

Code answers related to "how to ask for token in header axios"

Browse Popular Code Answers by Language