Request Blocked by CORS Policy - VueJS


When try Oxford API with Postman there is no problem but when I try to use it on my Vue project request keep blocked by CORS Policy.

my code is:

methods: { getWord() { Axios.get(${this.word
}?fields=definitions&strictMatch=false, { headers: { Accept: 'application/json', app_id: '00000000000', app_key: 'xxxxxxxxxxxxxxxxxxxxx', }, }).then((response) => { console.log('-----SUCCESS-----'); this.posts = response; console.log(this.posts); }).catch((err) => { console.log(this is the error: ${err}); }); }, };
Browser gives this error:
Access to XMLHttpRequest at '' from origin 'http://localhost:8080' 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.

Appreciate any help.

P.S.: word is cat



Sign In or Register to comment.