From fc5dbc1a8474d017e210b855c69bf09e81eff17b Mon Sep 17 00:00:00 2001 From: Nicolas Joubert Date: Wed, 26 Feb 2025 17:33:50 +0100 Subject: [PATCH] #12 PUT and PATCH with send: application/json must be send as json. --- src/Client/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client/Client.php b/src/Client/Client.php index 94d586f..a9f5827 100644 --- a/src/Client/Client.php +++ b/src/Client/Client.php @@ -159,7 +159,7 @@ protected function getRequestOptions(array $options = []): array if (!empty($options['expects'])) { $requestOptions['headers']['Accept'] = $options['expects']; } - if ('POST' === $options['method'] && 'application/json' === $options['sends']) { + if (\in_array($options['method'], ['POST', 'PATCH', 'PUT']) && 'application/json' === $options['sends']) { $requestOptions['json'] = $options['data']; } elseif ('GET' === $options['method']) { $requestOptions['query'] = $options['data'];