i have created rest ful api , web application using laraval 5 .. have created 1 web service register , same function i'm trying use in web application.
if use function web service input paramenter format should json.... in web application inputs parameter..
so can't able getting problem inputs...
i have tried
$post = file_get_contents ( "php://input" ); $data = json_decode ( $post, true ); return $data; it has been return array in api call web application return empty..
i tried below formats
input::json()->all(); input::all(); nothing workout ..please help
if understand correctly, need simple:
return json_encode(input::all()); to explain more:
input::all() - give array request parameters, can later turn json file_get_contents ( "php://input" ) - give query string, after json_encode still string
Comments
Post a Comment