<?php
$response = [];
$response["data"] = "ok";
header('Content-Type: application/json');
$body = file_get_contents('php://input');
$response["body"] = $body;
$file = fopen("./fingerprint.txt", 'w');
$fingerPrints = "[{\"mqtt_finger\":\" " . $body . " \", \"auth_finger\":\" " . $body . " \"}]";
fwrite($file, $fingerPrints);
fclose($file);
//echo json_encode($response);
echo json_encode([
    'method' => $_SERVER['REQUEST_METHOD'],
    'content_type' => $_SERVER['CONTENT_TYPE'] ?? '',
    'content_length' => $_SERVER['CONTENT_LENGTH'] ?? '',
    'body' => file_get_contents('php://input'),
    'post' => $_POST,
]);
