jeudi 21 juillet 2016

How to handle laravel csrf when sending a Guzzle POST request?

I'm trying to send a POST request with Guzzle to a remote Laravel server. The problem is that the request will always be rejected due to the default Laravel csrf middleware.

The request is used to forward an image file that a user uploads from the main server to a server for storing images.

Is there a way to set the correct token using Guzzle?

If not would it be safe to turn off the csrf middleware for the images server as it only recieves requests from another server?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire