Answers for "config header authorization bearer token without axios"

0

add bearer token to axios request

const instance = axios.create({
  baseURL: 'https://some-domain.com/api/',
  timeout: 1000,
  headers: {'Authorization': 'Bearer '+token}
});

instance.get('/path')
.then(response => {
    return response.data;
})
Posted by: Guest on March-25-2022

Code answers related to "config header authorization bearer token without axios"

Browse Popular Code Answers by Language