Hello All.
I have to query a WS with laravel, but I am not getting the correct response. If I get the correct response with the curl command in the operating system console.
this is the console command:
curl https://domain:8001 -H "Authorization: token
This is the controller method:
public function check_user (Request $request){
$validated = $this->validate($request, [
'user' => 'required',
]);
$response_user = Http::withHeaders(
['Authorization' => 'token'])->get("https://domain:8001");
return response()->json([
'status' => true,
'user' => $response_user,
], 201);
}
With that method controller I get this json response which is not right:
{"status":true,"user":{"cookies":{},"transferStats":{}}}