how this code code works and what is “params” here?
Params is the parameter of the URL. Also can be easily understood by the term key-value pair. In the URL the parameters are put into a query string, where parameters are its components.
If you look at the send_telegram_message function, data holds the values that works like key and value (chat_id and text - are key).
You can try running the URL with the values by default in your browser and you’ll see the message being sent to the chat_id by the bot_id.
For more info what telegram APIs are capable of - https://core.telegram.org/bots/api#sendmessage
Let me know if you need any more information.
what this “POST” is doing?
POST is used to send data to a server, to create or update a resource.
These are HTTP methods. Like GET, POST, PUT, DELETE etc
Thank you for clarification
Basically Run/open a URL, and do the HTTP methods.
POST for updating, GET for requesting/gathering.