K
K
Keffer2018-10-24 06:33:01
API
Keffer, 2018-10-24 06:33:01

Sending messages from telegram bots via https request, how to implement?

Everyone knows that a message from a bot can be sent to a chat by clicking on the link in the browser
https://api.telegram.org/bot50your_bot_token/sendm...
In Mikrotik routers, this is wonderfully implemented in scripts using the fetch utility. On different events, fetch loads the required URL and as a result we get convenient monitoring.
I would like to implement the same thing under windows so that you can track different events and send messages on behalf of the bot.
I tried to implement an http request through the wget utility, the result is not encouraging:

Распознаётся api.telegram.org... 149.154.167.220
Устанавливается соединение с api.telegram.org|149.154.167.220|:443... соединение установлено.
ПРЕДУПРЕЖДЕНИЕ: невозможно проверить сертификат api.telegram.org, запрошенный `/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./OU=http://certs.godaddy.co
m/repository//CN=Go Daddy Secure Certificate Authority - G2':
  Обнаружен самостоятельно подписанный сертификат.
Запрос HTTP послан, ожидается ответ... 400 Bad Request
2018-10-24 08:57:28 ОШИБКА 400: Bad Request.

Of course, I launched wget with the key: wget --no-check-certificate but the certificate is most likely not to do with it. In the browser this http request perfectly fulfills.
What other options are there from under Windows to implement similar http requests without opening browsers?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vadim, 2018-10-24
@Keffer

powershell )
https://habr.com/post/317906/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question