Created
August 2, 2021 17:18
-
-
Save jhowbhz/212bdcd6ee44a4af69578b17cfe7cede to your computer and use it in GitHub Desktop.
get body exception request GuzzleHttp GuzzleHttp\Exception\ClientException
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
$response = $this->client->request('GET', 'api', [ | |
'query' => $params | |
]); | |
} catch (GuzzleHttp\Exception\ClientException $e) { | |
$response = $e->getResponse(); | |
echo (string)($response->getBody()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment