Answers for "how to add authorization bearer in header axios"

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 "how to add authorization bearer in header axios"

Browse Popular Code Answers by Language