verbessert, evt
This commit is contained in:
@@ -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));
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user