Answers for "access-control-request-headers axios"

1

axios get request with headers in token

axios.get('https://api.github.com/user', {
  headers: {
    'Authorization': `token ${access_token}`
  }
})
.then((res) => {
  console.log(res.data)
})
.catch((error) => {
  console.error(error)
})
Posted by: Guest on April-19-2021
15

axios post with header

// Send a POST request
axios({
  method: 'post',
  url: '/user/12345',
  data: {
    firstName: 'Fred',
    lastName: 'Flintstone'
  },
  headers: {'Authorization': 'Bearer ...'}
});
Posted by: Guest on April-13-2020

Code answers related to "access-control-request-headers axios"

Code answers related to "Javascript"

Browse Popular Code Answers by Language