From 529cc732852f9b52a350b229906dc4aa64cfc43d Mon Sep 17 00:00:00 2001 From: Felipe Fiebig Date: Mon, 8 Nov 2021 15:31:32 -0300 Subject: [PATCH] Fix Guzzle 5 method call --- src/Utils/HttpClient.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Utils/HttpClient.php b/src/Utils/HttpClient.php index f24fa07b..d87e75d0 100644 --- a/src/Utils/HttpClient.php +++ b/src/Utils/HttpClient.php @@ -33,7 +33,7 @@ public function request($method, $url, $payload = [], $options = null) $baseHeaders = [ 'Content-Type' => 'application/json', - 'User-Agent' => 'SDK-PHP/'.$installedVersion, + 'User-Agent' => 'SDK-PHP/' . $installedVersion, ]; $givenHeaders = isset($options['headers']) ? $options['headers'] : []; @@ -66,10 +66,12 @@ protected function sendGuzzle5Request($method, $url, array $headers, $payload) { $client = new Client(); - return $client->request($method, $url, [ + $request = $client->createRequest($method, $url, [ 'headers' => $headers, 'body' => $payload, ]); + + return $client->send($request); } /**