diff --git a/figo/Connection.php b/figo/Connection.php index 49e04f3..09afaf1 100644 --- a/figo/Connection.php +++ b/figo/Connection.php @@ -107,8 +107,10 @@ public function query_api($path, array $data = null, $method='POST', $encode='ht } $headers = array("Authorization" => "Basic ".base64_encode($this->client_id.":".$this->client_secret), - "Content-Type" => $content_type, "Content-Length" => strlen($data)); + if (strlen($data) > 0) { + $headers["Content-Type"] = $content_type; + } $request = new HttpsRequest($this->apiUrl['host'], $this->fingerprints, $this->logger); $path = $this->apiUrl['path'] . $path;