Skip to content

Commit f19d656

Browse files
Fixed bug that testing client cannot support json without POST. (#7309)
1 parent 1d95c8e commit f19d656

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public function initRequest(string $method, string $path, array $options = []):
184184
$uri = (new Uri($this->baseUri . ltrim($path, '/')))->withQuery(http_build_query($query));
185185

186186
$content = http_build_query($params);
187-
if ($method == 'POST' && data_get($headers, 'Content-Type') == 'application/json') {
187+
if (data_get($headers, 'Content-Type') == 'application/json' && ! empty($json)) {
188188
$content = json_encode($json, JSON_UNESCAPED_UNICODE);
189189
$data = $json;
190190
}

0 commit comments

Comments
 (0)