From de8ed2fbc92138fc0f3317027671729a8115a46f Mon Sep 17 00:00:00 2001 From: Christopher Georg Date: Sun, 14 Aug 2022 11:28:31 +0200 Subject: [PATCH] feat: add https://github.com/sqmk/Phue/pull/145 needs testing --- library/Phue/Transport/Adapter/Curl.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/Phue/Transport/Adapter/Curl.php b/library/Phue/Transport/Adapter/Curl.php index a2665d1..393ee96 100644 --- a/library/Phue/Transport/Adapter/Curl.php +++ b/library/Phue/Transport/Adapter/Curl.php @@ -53,6 +53,9 @@ public function send(string $address, string $method, string $body = null): stri curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, true); if (!is_null($body) && strlen($body)) { + + /* @see https://github.com/sqmk/Phue/pull/145 */ + curl_setopt($this->curl, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Accept: application/json']); curl_setopt($this->curl, CURLOPT_POSTFIELDS, $body); }