Http request - 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: Http request (/showthread.php?tid=5792) |
Http request - FatMax - 15.12.2024 I am struggling a litte bit with understanding what is going wrong here: Code: function set_light_state(id, is_on) The server throws an error when using this function. The response is not helpful as it seems like an internal server error. I am guessing it has something to do with the payload, as the curl opposite of this function works fine: Code: curl -X PATCH "https://{IP}}/v1/devices/{ID}" \ Is the payload formatted correctly as in the curl? RE: Http request - admin - 16.12.2024 You are missing Content-Length header: Code: ["Content-Length"] = #payload, RE: Http request - FatMax - 16.12.2024 That did the trick, thank you! |