I am currently getting the above error, I am using Axios to make the GET request an external API. Having read the Mozilla docs, doing a lot of research and trying to use different options, I still feel no better.
I canceled the code 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 as soon as I can convey the CORS problem, everything will work.
source
share