diff --git a/src/TogglApi.php b/src/TogglApi.php index 32508ee..8dba214 100644 --- a/src/TogglApi.php +++ b/src/TogglApi.php @@ -32,7 +32,13 @@ public function __construct($api_token) private function GET($endpoint, $body = array(), $query = array()) { - $response = $this->client->get($endpoint, ['body' => json_encode($body), 'query' => $query]); + $options = [ + 'query' => $query, + ]; + if ($body){ + $options['body'] = json_encode($body); + } + $response = $this->client->get($endpoint, $options); return $this->checkResponse($response); }