Whenever I attempt to execute the "getUserData" method, it results in a 401 (Unauthorized) error. Strangely enough, when I make a GET request to the URL "" with the same headers in Postman, it works perfectly fine! How can I properly set my request headers?
this.$http.get('http://ppstemp.com/api/User/Profile',{params:{
n: ...
}} , {
headers: {
"Authorization": "bearer "+ localStorage.getItem('token') ,
"Accept": "application/json",
"cache-control": "no-cache"
}
}).then(
(response) => {
// Handle data returned
console.log(response.data);
},
//error callback
(err) => console.log(err));
}