hi all,
i need to send a HTTP POST request with message body to an ip in my local network and i don’t know how to do that.
the http-binding can’t do that as mentioned in the http binding documentation:
It is currently not possible to send a message body, as one might do typically with the POST HTTP method. An alternative solution, in the case where the receiving web server requires a message body, might be to execute curl … -d using the exec binding.
so i need to use the exec binding…
the message body that has to be sent is this one:
{“communication_base_params”:{“type”:“Message”,“fallback”:false,“via”:“OH”},“sender”:“PRiVATE_KEY”,“ttl”:0,“message”:“wakeup”,“version”:“1.63”}
i tried the following:
Switch tabletdisplay "Tablet Displaysteuerung" { exec=">[curl -XPOST http://192.168.178.29:1817 -d '{\"communication_base_params\":{\"type\":\"Message\",\"fallback\":false,\"via\":\"OH\"},\"sender\":\"PRIVATE_KEY\",\"ttl\":0,\"message\":\"hello\",\"version\":\"1.63\"}']"}
can somebody with “curl knowledge” show me how the request should be defined?
thx,
stefan