0

I try to make a http request to this address in angular2

http://api.football-data.org/v1/competitions/398/teams

It works fine until today I got an error message saying :

Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight response.

While I can access this url through browser. What could the problem be? What is the difference bettween making this http request through browser and using angular2. For my chrome browser I also install the cors extension on chrome.

2 Answers 2

1

One solution is config the CORS on the server.

0

it turns our the cors chrome extension is not woring properly and once I restart it everything works again.

Another solution is to use a proxy or add a cors header on the server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.