Well in short i cant get it to work!
in curl in the commandline it works.
In the Rule script it doesn’t.
In the tail of the log (very handy that screen).
I don’t see any error (i seet he correct prints).
Also if i try to get the result of the execution i can’t show it anywhere:
var result = "";
val headers = newHashMap("Authorization" -> "Bearer oh.api.4LEObyXg4YZtR7fbvKsbiebcXJz1ItVn9E4SLmvlm8SJvzbneItFU4CQBnKTR0PSOYonrfrigTu3kOFzPWvw");
result = sendHttpPutRequest("http://192.168.1.76:8080/rest/thing/http:url:7dc8fc6207/enable", "text/plain", "True", headers, 1000);
logInfo("Auto StartStop Things", result );
You are focusing on the cause but i also could have a typo in the device or whatever other typo one can made.
You shoudn’t defend a empty response from a method. I mean how can a response ever be empty? The hole point of a response method is that you get something usefull back.
The answer it should have given back is something like: i don’t have that url → “thing”.
The API explorer don’t uses the same API key and changes : for other characters.
Sometimes it not about right or wrong its about could it be better.
That’s what makes the difference between a good and a great system.
“text/plain” is what the API Explorer prescribes.
If it would answer with JSON then thats fine too.
It’s what it does anyway now when it works. I only corrected the typo.