I'm performing and API that receive json object, but cannot read it. Actually I don't know if it should be received as Request, or how...
First I try to get the json and decode it to an array. After that, I return the same array to json in the response. But it's returned as empty ({})
That's my route
Route::post('enviar_encuestas', 'EncuestaUsuarioController@store');
And in my controller, for that method I perform the following
public function store(Request $request){
$users = json_decode($request);
return response()->json($users);
}
In Postman I send perform the following HTTP POST Request to
https://encuestasapi.informixsys.com.ar/public/enviar_encuestas
I select Body and raw, after that I select JSON(application/json) and write the following
{
"id_encuesta" : 1,
"email" : "[email protected]",
"razon_social" : "asd",
"nro_ref_autopack" : 1
}