CURL, SendHTTPRequest, to change rest items

Openhab 2.5.10

Trying to update some items in the REST-API
“link”: “”,

I’ve tried CURL
executeCommandLine(“curl --header “Content-Type: text/plain” --request PUT --data “ON””)

Openhab won’t even let me load that:
Configuration model ‘Test.rules’ has errors, therefore ignoring it: [13,36]: missing ‘)’ at ‘Content’
[13,48]: mismatched input ‘:’ expecting ‘end’
I’ve tried so many variations with quotes I still can’t get it to load

I’ve tried sending an httpputrequest:
sendHttpPutRequest(“”, “application/json”, ‘{“state”:“ON”}’)

When i run that, openhab log states:
Received HTTP PUT request at ‘items/IsSunset’ with an invalid item type ‘null’.

I just want to be able to update things like this to quickly test a series of rules.

How can i structure one of these to do what I’m attempting to do?


Does this work

executeCommandLine("curl --header 'Content-Type: text/plain' --request POST --data 'ON'", 2000)


No it doesn’t do anything. It loads; when i run it; i don’t even see a log entry.

I did mess around with my other one some more; i got it to load AND execute, BUT it doesn’t change the state of the item. So now I’m even more confused.

executeCommandLine("curl --header \"Content-Type: text/plain\" --request PUT --data \"ON\"")

2021-01-23 11:13:32.163 [INFO ] [] - executed commandLine ‘curl --header “Content-Type: text/plain” --request PUT --data “ON”

I have found a solution:
sendHttpPutRequest("", "text/plain", 'OPEN')