0

I am new in angular 5 and I am having this issue that is blowing my mind.

When I generate a request to this external server (I don't have access to it) I am getting the following error:

Failed to load http://api.football-data.org/v1/fixtures?timeFrame=p5: Request header field Access-Control-Allow-Origin is not allowed by Access-Control-Allow-Headers in preflight response.

I already read that this would be probably caused by a Server configuration. What I don't understand is why if I create the request with a HTTP requester extension I have a response with no problem, also with the browser.

What coud be wrong with my angular app?

Thanks in advance!!

1 Answers1

0

You are correct, this is caused by a server configuration. See the documentation here: https://angular.io/guide/deployment#requesting-services-from-a-different-server-cors

And to answer why it works in your HTTP requester extension, I assume it is the same reason postman works: CORS with POSTMAN

This may also be helpful: https://developer.chrome.com/extensions/xhr

DeborahK
  • 57,520
  • 12
  • 104
  • 129
  • Thanks for our help !!! My workaround was to install a Allow Control Allow Origin until server managers fix this. – Agustin Aug 03 '18 at 12:12