U
U
Uryuk2018-08-11 15:19:35
PHP
Uryuk, 2018-08-11 15:19:35

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);
}

Already checked, logs come if I send POST requests from my second server.
What is the problem? Tell me please.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question