Hello,
I like to update a variable in pimatic with phone my
code is
$data = array("value" => "133");
$data_string = json_encode($data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Content-Length: ' . strlen($data_string)));
curl_setopt($ch, CURLOPT_URL, 'http://(server)/api/variables/variable_string_today');
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($ch, CURLOPT_USERPWD, "user:password");
curl_exec($ch);
if(curl_error($ch))
{
echo 'error:' . curl_error($ch);
}
And the error is
error:Empty reply from server
What is wrong? @Gleno0h can you help once more?
It’s solved I can post the code later.