I’m using GuzzleHttp for making HTTP requests on my Laravel project. However, I’m having trouble retrieving the body of the response using Guzzle. Here’s a simplified version of my code:
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', $api_url);
$body = $response->getBody();
When I try to access the body of the response using $response->getBody()
, it does not give me the expected result. Can anyone guide me on how to properly get the body of a response from Guzzle in Laravel?