Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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;
})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #bearer #token #axios #request
ADD COMMENT
Topic
Name
7+8 =