I am currently getting the above error, I am using Axios to make the GET request to an external API. After reading the Mozilla docs, doing a lot of research and trying different options I am still not any better off.
I have stripped the code back to the basics:
axios.get('URL.com', {
headers: {
Access-Control-Allow-Origin: *
},
auth: {
username: 'username',
password: 'password'
},
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
Do I need to add anything else to the headers?
Everything works through Postman so once I can pass the CORS issue everything will work.