<?php
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers:*");
ini_set("allow_url_fopen", true);
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$printString = "";
foreach ($_GET as $key => $value) {
$printString = $printString . "Key: " . $key . " Val: " . $value . "\n";
}
file_put_contents("getRequest.txt", $printString);
if (isset($_GET['hub_challenge'])) {
$challenge = $_GET['hub_challenge'];
echo $challenge;
}
}
}
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$payload = "POST received\n";
//$payload = file_get_contents('php://input');
file_put_contents("payload.txt", $payload);
}
?>
There’s not much going on in the handler right now. I’m just writing to a file to see if a request is coming through.