22.01.2022, 23:07
(22.01.2022, 22:58)Erwin van der Zwart Wrote: Try this:
Code:require('socket.http') require("ltn12") res = {} body = '{"jsonrpc":"2.0","id":1,"method":"Input.Down"}' socket.http.request({ url = "http://user:passwd@192.168.0.24:8080/jsonrpc", method = 'POST', sink = ltn12.sink.table(res), headers = { ['content-length'] = #body, ['content-type'] = 'application/json', }, source = ltn12.source.string(body), }) log(res)
This works!
Bedankt Erwin!