Answer the question
In order to leave comments, you need to log in
How to remove No 'Access-Control-Allow-Origin' header is present on the requested resource error?
Good afternoon. Faced a problem. There is an api on laravel, I'm trying to get data through angular, to which I get in response:
XMLHttpRequest cannot load http://backend/api No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://frontend' is therefore not allowed access.
Answer the question
In order to leave comments, you need to log in
To the response from the server, you need to add the header Access-Control-Allow-Origin: '*' - to allow cross-domain requests for any addresses, or Access-Control-Allow-Origin: ' http://client-domain ' - for the elite.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question