Skip to content

Commit

Permalink
Merge pull request #8 from seatplus/develop
Browse files Browse the repository at this point in the history
fix body endcoding
  • Loading branch information
herpaderpaldent authored Oct 4, 2021
2 parents 28f35eb + 52e5e11 commit a5b4f25
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Fetcher/GuzzleFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ public function httpRequest(string $method, string $uri, array $headers = [], ar
$this->logger->debug('Making ' . $method . ' request to ' . $uri);
$start = microtime(true);

$body = count($body) > 5 ? json_encode($body) : null;
// json encode the body if present, else null it
$body = count($body) > 0 ? json_encode($body) : null;

try {
$response = $this->getClient()->request($method, $uri, [
Expand Down

0 comments on commit a5b4f25

Please sign in to comment.