meetDeveloper / freeDictionaryAPI

There was no free Dictionary API on the web when I wanted one for my friend, so I created one.

Home Page:https://dictionaryapi.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem about CORS while fetching api.dictionaryapi.dev

jm5276 opened this issue · comments

commented

Error while Fetching API response using a JS

you can recreate mine using this CORS command in Chrome DevTools console CTRL+SHIFT+J

fetch('https://api.dictionaryapi.dev/api/v2/entries/en/hello', {mode: 'cors'})

it will fetch the resource querying hello but will throw an error below

Access to fetch at 'https://api.dictionaryapi.dev/api/v2/entries/en/hello' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

i guess the problem is the missing response header like Access-Control-Allow-Origin: * or anything else

additional: all response returning Error 502