Answer the question
In order to leave comments, you need to log in
Why does Telegram send empty Post Requests?
Hello!
Set up a web hook https://api.telegram.org/bot-key/setWebhook?url=ht...
Received {"ok":true,"result":true,"description":"Webhook was set" in response }
But when sending messages to the bot, I get empty post requests from telegrams.
I log like this
$file_get = $_SERVER["DOCUMENT_ROOT"] . "/log/get.log";
$file_post = $_SERVER["DOCUMENT_ROOT"] . "/log/post.log";
$datas = json_decode(file_get_contents("php://input"),true);
if (!empty($_GET)) {
$fw = fopen($file_get, "a");
fwrite($fw, "GET " . var_export($_GET, true));
fclose($fw);
}
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$fw = fopen($file_post, "a");
fwrite($fw, "POST " .$datas.var_export($_GET, true));
fclose($fw);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question