axios.get('/api/data', {
headers: {
'Authorization': 'Bearer your-token',
'Content-Type': 'application/json'
}
})
.then(function (response) {
// Handle the response
console.log(response.data);
})
.catch(function (error) {
// Handle any errors
console.error(error);
});