HTTP/1.1 400 BAD REQUEST Fehler womöglich behoben

This commit is contained in:
belevo\mh
2024-10-16 08:25:24 +02:00
parent 53b6f09b7c
commit 4067678f6b
2 changed files with 8 additions and 5 deletions

View File

@@ -132,13 +132,16 @@ return $json;
IPS_LogMessage("Belevo_Server_Kommunikation", "InfluxDB-Token fehlt->SendJsonToInfluxDB"); IPS_LogMessage("Belevo_Server_Kommunikation", "InfluxDB-Token fehlt->SendJsonToInfluxDB");
return; return;
}*/ }*/
$headers = [
"Content-Type: application/json",
//"Authorization: Bearer $token" // Wenn der Token gebraucht wird, füge ihn hier hinzu
];
$options = [ $options = [
'http' => [ 'http' => [
'header' => "Content-Type: application/json\r\n". 'header' => implode("\r\n", $headers),
"daten: $json".
"id: test\r\n",
'method' => 'POST', 'method' => 'POST',
'content' => $json, // Hier wird das JSON im Body gesendet
], ],
]; ];
$context = stream_context_create($options); $context = stream_context_create($options);

View File

@@ -6,7 +6,7 @@
"compatibility": { "compatibility": {
"version": "7.1" "version": "7.1"
}, },
"version": "0.38", "version": "0.39",
"build": 0, "build": 0,
"date": 0 "date": 0
} }