From 8c275f92080148dabf0747b334d20ea5ba68d588 Mon Sep 17 00:00:00 2001 From: Benjamin Calef Date: Mon, 6 May 2024 12:46:15 +0200 Subject: [PATCH] [v2.0.2] unset body when required --- Service/ApiBuilder.php | 1 + composer.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Service/ApiBuilder.php b/Service/ApiBuilder.php index 75c24ce..23313e3 100644 --- a/Service/ApiBuilder.php +++ b/Service/ApiBuilder.php @@ -139,6 +139,7 @@ private function getOptions(ApiProviderInterface $apiProvider, RequestAdapter $r $contentType = $requestAdapter->getHeaders()['Content-Type'] ?? null; if ($contentType === 'application/x-www-form-urlencoded') { $options['form_params'] = $body; + unset($options['body'], $options['query']); } $options['headers'] = $requestAdapter->getHeaders(); $options['verify'] = $apiProvider->isVerify(); diff --git a/composer.json b/composer.json index 009ec4f..2e31462 100755 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "zepgram/module-rest", "description": "Technical module to industrialize API REST call with dependency injection pattern using Guzzle library", "type": "magento2-module", - "version": "2.0.1", + "version": "2.0.2", "authors": [ { "name": "Benjamin Calef",