07.02.2023, 08:02
Try this:
Code:
http = require('socket.http')
ltn12 = require('ltn12')
body = '{"iZoneV2Request": {"Type": 1,"No": 0,"No1": 0}}'
resp = {}
url = 'http://...'
res, code = http.request({
url = url,
method = 'POST',
headers = {
['Content-Type'] = 'application/json',
['Content-Length'] = #body,
},
source = ltn12.source.string(body),
sink = ltn12.sink.table(resp),
})
log(res, code, resp)