Ich hab das
curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "ON" "http://192.168.32.208:8080/rest/items/Thujen_Outlet_VentilGeFfnet"
könnte mir bitte jemand das in PHP übersetzen?
ich hab bisher, das, das tut aber nix.
$ch = curl_init();
$url="http://192.168.32.208:8080/rest/items/".$item;
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$value);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: text/plain","Accept: application/json"));
$result = curl_exec($ch);
var_dump($result);
curl_close ($ch)
Ich weiß, das hatten wir schon mal. Aber diesmal soll der Wert im Body als Text vorhanden sein.