mardi 27 juin 2017

Laravel 5 and Angular. Cors error when send data from frontend to backend

I have problems sending data from a form by the Post method (I'm using Angular 4). I get the following error:

XMLHttpRequest cannot load http://ift.tt/2s0dTky. Response to 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.

I added the "Cors" to the application and thanks to that, using Postman I can create new users enter image description here

I also reviewed the Laravel log but I have this information:enter image description here

I have uploaded my code to Gist so that anyone who wants to help me makes it easier.

http://ift.tt/2tjbpl6

Any help, thank you very much.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire