I am trying to call a secured rest API from the angular app. This rest API is running on WAS, and it is validating a JWT token. While running the application in google chrome, it is giving the below error:
Response to the preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access.
The same call is working fine in IE and postman. Could you pls help me here?
Your server needs to specify the correct CORS headers in its response.
See https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers
Only browsers enforce CORS, thats why it works in POSTMAN, not sure why it is working in IE
If only I had a pound for every time someone asked this question.