protected static function convertJson($response) { $body = $response->getBody(); $json = ''; while (!$body->eof()) { $json .= $body->read(1024); } return json_decode($json); }