Skip to content

Commit 5d7ea7a

Browse files
committed
fix: ne pas envoyer de request body si vide #IGNGPF-5212
1 parent 3569eed commit 5d7ea7a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Services/AbstractApiService.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,11 @@ protected function prepareOptions(iterable $body = [], array $query = [], array
173173
];
174174
} else {
175175
$options = [
176-
'json' => $body,
177176
'headers' => array_merge($defaultHeaders, $headers),
178177
];
178+
if (!empty($body)) {
179+
$options['json'] = $body;
180+
}
179181
}
180182

181183
/** @var AccessToken */

0 commit comments

Comments
 (0)