From 566ab3fc705f319fc44b959f7a60583b935c3fbe Mon Sep 17 00:00:00 2001 From: Linus Metzler Date: Tue, 3 Oct 2017 21:16:58 +0200 Subject: [PATCH] Don't run json_encode Guzzle takes care of this thanks to its JSON middleware --- src/Adapter/Guzzle.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Adapter/Guzzle.php b/src/Adapter/Guzzle.php index 205ff84..bdbddcd 100644 --- a/src/Adapter/Guzzle.php +++ b/src/Adapter/Guzzle.php @@ -67,13 +67,11 @@ class Guzzle implements Adapter */ public function put(String $uri, array $headers = [], array $body = []): ResponseInterface { - $jsonBody = json_encode($body); - $response = $this->client->put( $uri, [ 'headers' => $headers, - 'json' => $jsonBody + 'json' => $body ] ); @@ -86,13 +84,11 @@ class Guzzle implements Adapter */ public function patch(String $uri, array $headers = [], array $body = []): ResponseInterface { - $jsonBody = json_encode($body); - $response = $this->client->patch( $uri, [ 'headers' => $headers, - 'json' => $jsonBody + 'json' => $body ] );