I try to get away from passing a command to an item like
http://openhab:8080/basicui/CMD?Testitem=ON
(which works fine) and want to move to REST API. I have seen quite a few comments here, where this issue was addressed but not solved.
However, I still think there is a way of achieving this but need a little help for the last bit:
In a browser this will execute a javascript containing a HTML “file” with all required information. I am still struggling how to correctly submit the command value “ON”.
I already get a response from OH-Server but with the following error message:
{"error":{"message":"HTTP 404 Not Found","http-code":404,"exception":{"class":"javax.ws.rs.NotFoundException","message":"HTTP 404 Not Found","localized-message":"HTTP 404 Not Found"}}}
This works here.
Then use a network sniffer to capture the packages.
Then run a network sniffer to capture the packages from your javascript running in the browser and compare the content of both captured network transmissions.