I'm currently developing a messenger BOT where the BOT is on an server A hidden with a vpn.
So I have a server B which gets the request and sends it to the server A. The problem is that I'm able to send messages and quick replies with A when I send an http request directly. But A never get curl request from B.
The second problem and the main, is that the first server don't 'always' get the request from the Facebook server. In my code I copy past the content of php://input to text.txt on both server A and B to investigate
if (($response = file_get_contents("php://input")) === FALSE) {
file_put_contents("text.txt", "error get");return false;
}
if (($json = json_encode($response)) === FALSE) {
file_put_contents("text.txt", "decode");return false;
}
file_put_contents("text.txt", $json);
when I docurl -X POST -H "Content-Type: application/json" -d '{"name": "linuxize", "email": "[email protected]"}' myserver.com
I always get the data on server B
But when I send message on messenger, and that I should get an HTTP request to B, I don't get the request OR I get an older request which is always with the same content except the "time". But the timestamp is the same.
If anyone understand/know why I don't always get the right data in php://input it would be awesome
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.
PHP (from the English Hypertext Preprocessor - hypertext preprocessor) is a scripting programming language for developing web applications. Supported by most hosting providers, it is one of the most popular tools for creating dynamic websites.
The PHP scripting language has gained wide popularity due to its processing speed, simplicity, cross-platform, functionality and distribution of source codes under its own license.
https://www.php.net/
Welcome to the Q&A site for web developers. Here you can ask a question about the problem you are facing and get answers from other experts. We have created a user-friendly interface so that you can quickly and free of charge ask a question about a web programming problem. We also invite other experts to join our community and help other members who ask questions. In addition, you can use our search for questions with a solution.
Ask about the real problem you are facing. Describe in detail what you are doing and what you want to achieve.
Our goal is to create a strong community in which everyone will support each other. If you find a question and know the answer to it, help others with your knowledge.