Answers for "how to send authorization token in axios"

0

Axios Req with Auth Token

// 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
-1

axios authorization bearer

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

const bodyParameters = {
   key: "value"
};

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

Code answers related to "how to send authorization token in axios"

Browse Popular Code Answers by Language