Skip to content

Commit b906be3

Browse files
authored
Do not send request with null body (#1191)
1 parent 7cead30 commit b906be3

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
- Make the injected HttpClient decorated by our `RetryableHttpClient`
88
- Support for KMS
99

10+
### Fixed
11+
12+
- Issue with symfony http-client when posting empty payload
13+
1014
## 1.13.0
1115

1216
### Added

src/AbstractApi.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,7 @@ final protected function getResponse(Request $request, ?RequestContext $context
154154
$request->getEndpoint(),
155155
[
156156
'headers' => $request->getHeaders(),
157-
'body' => 0 === $length ? null : $requestBody,
158-
]
157+
] + (0 === $length ? [] : ['body' => $requestBody])
159158
);
160159

161160
if ($debug = filter_var($this->configuration->get('debug'), \FILTER_VALIDATE_BOOLEAN)) {

0 commit comments

Comments
 (0)