Guzzle HTTP Drupal 8 Calling

try {
	$result = $client->get(URL_OF_API);
	$stream = $result->getBody();
	$jsonData = $stream->getContents(); // returns all the contents
	$dataArray = json_decode($jsonData);
	print_r($dataArray);
}
catch (\GuzzleHttp\Exception\ClientException $e) {
	$response = $e->getResponse();
}