curl to lua - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: curl to lua (/showthread.php?tid=3823) |
curl to lua - baggins - 22.01.2022 Hi, I am trying to convert a curl command to lua but cannot get it to work... This is the curl command: Code: curl -X POST \ Code: {"id":"1", "jsonrpc":"2.0", "result":"OK"} This is the lua code: Code: socket = require('socket.http') Code: testing 22.01.2022 16:14:46 Any hints? TIA. RE: curl to lua - Erwin van der Zwart - 22.01.2022 Try this: Code: require('socket.http') RE: curl to lua - baggins - 22.01.2022 (22.01.2022, 22:58)Erwin van der Zwart Wrote: Try this: This works! Bedankt Erwin! RE: curl to lua - admin - 24.01.2022 Specifying sink is not needed in newer firmwares. The library will create a sink automatically and will return the request result as a string. RE: curl to lua - baggins - 24.01.2022 (24.01.2022, 07:08)admin Wrote: Specifying sink is not needed in newer firmwares. The library will create a sink automatically and will return the request result as a string. I am on 20160714 firmware... |