Skip to content

Commit 1833443

Browse files
#12 PUT and PATCH with send: application/json must be send as json.
1 parent 072076e commit 1833443

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Client/Client.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ protected function getRequestOptions(array $options = []): array
159159
if (!empty($options['expects'])) {
160160
$requestOptions['headers']['Accept'] = $options['expects'];
161161
}
162-
if ('POST' === $options['method'] && 'application/json' === $options['sends']) {
162+
if (in_array($options['method'], ['POST', 'PATCH', 'PUT']) && 'application/json' === $options['sends']) {
163163
$requestOptions['json'] = $options['data'];
164164
} elseif ('GET' === $options['method']) {
165165
$requestOptions['query'] = $options['data'];

0 commit comments

Comments
 (0)