I'm building an application in Laravel 5.5 where I'm calling an api request to get response, I've following in my controller:
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'http://www.conxn.co.in/CoxnsvcA.svc/Login');
dd($response);
I'm able to get something like this:
But while doing $response->getBody(); I'm unbale to get the response. when I do dd($response->getBody() I'm getting:
In postman it is showing something like this:
Help me out with this.
Thanks.



(string) $response->getBody()? The method will return a stream, which requires special handling depending on what you are trying to do. Maybe you can show a larger part of the code? For example what do you get get instead of the response data when you call$response->getBody()?(string) $response->getBody()it will make it a regular string. You could also use Guzzle's helper method$data = $response->json();to get the data from the response already parsed, when you know it's json