verbessert, evt

This commit is contained in:
belevo\mh
2024-11-04 15:13:19 +01:00
parent 7ddb8936d4
commit 0ed1cb0a71
2 changed files with 5 additions and 32 deletions

View File

@@ -130,45 +130,18 @@ return $json;
private function SendJsonToInfluxDB($url, $json) private function SendJsonToInfluxDB($url, $json)
{ {
// $token = "Token iFNTONC5UvST8GT5itWqxiO6m4O1yHt5hus54J8eqotk5IZiq0Wjd0_Xi6dozmo32QR3esJqk6hJAvJ8X2SxtQ=="; // Header für die Anfrage definieren
/*
if (empty($token)) {
IPS_LogMessage("Belevo_Server_Kommunikation", "InfluxDB-Token fehlt->SendJsonToInfluxDB");
return;
}*/ /*
$headers = [ $headers = [
"Content-Type: application/json", "Content-Type: application/json",
//"Authorization: Bearer $token" // Wenn der Token gebraucht wird, füge ihn hier hinzu "id: test" // Die ID, die vom Flask-Server überprüft wird
]; ];
// Optionen für den HTTP-Request definieren
$options = [ $options = [
'http' => [ 'http' => [
'header' => implode("\r\n", $headers), 'header' => implode("\r\n", $headers),
'method' => 'POST', 'method' => 'POST',
'content' => $json, // Hier wird das JSON im Body gesendet 'content' => $json // JSON-Inhalt im Body der Anfrage
],
];
*/
/*
$options = [
'http' => [
'header' => "Content-Type: application/json\r\n",
'method' => 'POST',
'content' => $json
],
];*/
$options = [
'http' => [
'header' => "Content-Type: application/json\r\n".
"id: test\r\n",
'method' => 'POST',
], ],
]; ];
IPS_LogMessage("Belevo_Server_Kommunikation", "Options: " . print_r($options, true)); IPS_LogMessage("Belevo_Server_Kommunikation", "Options: " . print_r($options, true));

View File

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