Answers for "axios how to set a bearer token to header"

2

axios send bearer token

const config = {
    headers: { Authorization: `Bearer ${token}` }
};

Axios.post( 
  'http://localhost:8000/api/v1/get_token_payloads',
  config
).then(console.log).catch(console.log);
Posted by: Guest on May-06-2021
7

axios bearer token

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

Code answers related to "axios how to set a bearer token to header"

Browse Popular Code Answers by Language