From 6aa5ff0587c8b91d04345db848d0a73554bcf81a Mon Sep 17 00:00:00 2001 From: Jonas De Keukelaere Date: Wed, 23 Nov 2022 16:46:34 +0000 Subject: [PATCH] Fix sending post requests During the refactor of get and post methods this bug was introduced, when setting the body, that method returns an modified object with the supplied body (immutable). --- src/Teamleader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Teamleader.php b/src/Teamleader.php index fdbca6d..b05e15c 100644 --- a/src/Teamleader.php +++ b/src/Teamleader.php @@ -186,7 +186,7 @@ private function doRequest(string $method, string $uri, array $parameters = []): } $body = $this->streamFactory->createStream($encodedParameters); - $request->withBody($body); + $request = $request->withBody($body); } $response = $this->client->sendRequest($request);