From 0f9d124803596fa158f991154adf60bfbcbab7a9 Mon Sep 17 00:00:00 2001 From: pvankouteren Date: Wed, 26 Feb 2025 13:16:11 +0100 Subject: [PATCH] In case a logger has been injected earlier, the contents of the response body can be logged. Therefor the response body should rewind to the beginning before getting the contents. --- src/Client.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Client.php b/src/Client.php index f9eacf2..5631032 100644 --- a/src/Client.php +++ b/src/Client.php @@ -59,6 +59,7 @@ public function request(string $method, string $uri, array $options = []) { $response = $this->client->request($method, $uri, $options); + $response->getBody()->rewind(); $contents = $response->getBody()->getContents(); // fallback to application/json as this is, apart from 1 call, the return type