Answers for "axios post headers authorization"

0

add authorization header axios

// Send a GET request with the authorization header set to
// the string 'my secret token'
const res = await axios.get('https://httpbin.org/get', {
  headers: {
    'Authorization': 'my secret token'
  }
});
Posted by: Guest on July-11-2020
0

axios headers basic authorization

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

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
1

axios default headers authorization

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

axios post headers authorization

//Data:name and passWord
//url:https://api-dev.thebar.ke
axios.post("url","Data").then(res => {
console.log(res)
localStroge.setItem("access",accessToken)
localStroge.setItem("refresh",refreshToken)
})
//برای لاگین فقط باید اطلاعتی که از ورودی گرفته میشود در هیدر فرستاده شود اگر اطلاعات فرستاده شده درست باشد شما می توانید به توکن دسترسی داشته باشد
//jaberBatoii
Posted by: Guest on May-15-2021

Browse Popular Code Answers by Language