I'm trying to get data from an end-point using VueJS and axios, but I keep getting the following CORS error on this code.
axios
.get(url, {
headers: {
"Access-Control-Allow-Origin": "*",
},
})
.then((response) => {
this.data = response.data;
});
Access to XMLHttpRequest at [url] from origin 'http://localhost:8081' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I've looked at multiple answers but the only solutions I'm seeing are using a Chrome extension or changing the server's configuration, which I do not have access to. Is there any way to solve this exclusively through the front-end?