dimanche 1 novembre 2015

How to get PUT data in laravel post using Curl

I'm trying to recieve PUT data sent using command line using curl.

curl -X PUT -H "Content-Type: application/json" -d '{"name":"Billy Bowler"}' -H "Authorization: BASIC <auth-token>" http://localhost/Bowling/public/api/leagues/1/bowlers

[auth-token] is a valid base64Encode(email + ":" + password).

I'm using Laravel 5, is there any way to get the data passed in routes/controller?

Right now I have tried with these:

Input::json->all();

Request::json()->all();  

file_get_contents("php://input");

Any help would be appreciated. Thanks.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire