- Code: Select all
local http = require("socket.http")
local ltn12 = require("ltn12")
local path = "http://IP:47147/api/v1/runactivity"
local payload = [[ {"activity_uuid":"CBD5ADC7-1E1A-4D28-AD0A-36518EE4785B"} ]]
local response_body = { }
local res, code, response_headers, status = http.request
{
url = path,
method = "POST",
headers =
{
["Content-Type"] = "application/json",
["Content-Length"] = payload:len()
},
source = ltn12.source.string(payload),
sink = ltn12.sink.table(response_body)
}
It comes from Vera plus Luup code. Thanks in advance!