diff --git a/library/Phue/Transport/Adapter/Curl.php b/library/Phue/Transport/Adapter/Curl.php index a209f83..2878635 100644 --- a/library/Phue/Transport/Adapter/Curl.php +++ b/library/Phue/Transport/Adapter/Curl.php @@ -60,7 +60,8 @@ public function send($address, $method, $body = null) curl_setopt($this->curl, CURLOPT_HEADER, false); curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, true); - if (strlen($body)) { + if (isset($body) && strlen($body)) { + curl_setopt($this->curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Accept: application/json')); curl_setopt($this->curl, CURLOPT_POSTFIELDS, $body); }