Answers for "axios get with auth header"

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 headers basic authorization

await axios.post(session_url, {}, {
  auth: {
    username: uname,
    password: pass
  }
});
Posted by: Guest on May-18-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language