Encountering a problem with CORS while attempting to execute a GET
request with an Authorization
token, but running into issues with OPTIONS. Seeking solutions on how to avoid sending OPTIONS when making a GET
request to another server.
$http({
url: request_data.url,
type: request_data.method,
withCredentials: true,
headers: {
'Authorization': localStorage.getItem('Auth'),
'Content-Type': 'application/json; charset=utf-8'
},
crossDomain: true
}).then(function(response) {
//process your data here
vm.prodData = response.data;
console.log(response.data);
});
Unable to send the request due to the CORS issue, likely related to the Authorization
header.