Request Blocked by CORS Policy - VueJS

Hi,

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(https://od-api.oxforddictionaries.com/api/v2/entries/en-gb/${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 'https://od-api.oxforddictionaries.com/api/v2/entries/en-gb/cat?fields=definitions&strictMatch=false' 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

Tagged:

Comments

Sign In or Register to comment.