I solved .
use GuzzleHttp\Exception\GuzzleException; use GuzzleHttp\Client;
$response = $http->post('http://localhost/oauth/token', [
'form_params' => [
'grant_type' => config('constants.p_grant_type'),
'client_id' => config('constants.P_client_id'),
'client_secret' => config('constants.P_client_secret'),
'username' => $request->email,
'password' => $request->password,
'scope' => '',
],
]);
return json_decode((string) $response->getBody(), true);
important no need header (json) This is absolutely necessary.(json_decode)