apilayer / restcountries

Get information about countries via a RESTful API
https://restcountries.eu
Mozilla Public License 2.0
2.24k stars 355 forks source link

CORS issue #47

Closed roddydairion closed 7 years ago

roddydairion commented 7 years ago

When connecting to the API using Ajax I get the following error message XMLHttpRequest cannot load https://restcountries.eu/rest/v2/name/m. Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight response.

It seems that the API needs to have CORS headers enabled.

fayderflorez commented 7 years ago

Hello @roddydairion I'm sorry for the delayed answer. Did you manage to solve your issue? If not, can you please specify how are you making the Ajax request?