Skip to content

Commit

Permalink
Use application/json in request headers
Browse files Browse the repository at this point in the history
  • Loading branch information
p-schneider committed May 16, 2022
1 parent d3b68fc commit 36854ca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/Phue/Transport/Adapter/Curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 36854ca

Please sign in to comment.