U
U
ugar20002020-08-05 22:11:31
CORS
ugar2000, 2020-08-05 22:11:31

CORS error Laravel. Why is my request not going through?

I'm learning to work with Laravel and trying to create my own API was not successful

Access to XMLHttpRequest at 'http://127.0.0.1:8000/api/heroes' from origin 'http://localhost:4200' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed.

GET http://127.0.0.1:8000/api/heroes net::ERR_FAILED

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
JhaoDa, 2020-08-05
@ugar2000

We read about CORS, we learn that requests from non-identical ports are blocked, we prescribe it in the CORS config http://localhost:4200.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question