03.06.2020, 18:40
It will work in new FW 2.5.0 which should be available in a month time.
For older fw it will work like this
For older fw it will work like this
Code:
function request(url)
local resp = {}
local stat, code, hdrs = require('ssl.https').request({
method = 'GET',
url = url,
protocol = 'tlsv12',
sink = ltn12.sink.table(resp),
})
if stat then
stat = table.concat(resp)
end
return stat, code, hdrs
end
local chat_id = '12345'
local token = 'wwwwwwwwwwwwwwwwwwwwwwwwww'
local telegram_url = 'https://api.telegram.org/bot' .. token .. '/sendMessage?'
message = "test"
message=require('socket.url').escape(message)
data_str = 'chat_id=' .. chat_id .. '&text=' .. message..''
stat, code, hdrs = request(telegram_url .. data_str)
------------------------------
Ctrl+F5
Ctrl+F5