Hi
I have following code in a rule in openhab 2.5.1-2:
val headers = newHashMap(“Authorization:” → token)
var responseJson = sendHttpPostRequest(urlSetTemp, “text/html”,‘{“mode”:{“id”: 105,“parentId”: 125,“mode”: “timeLimit”,“constTempTime”: 10,“setTemperature”: 100,“scheduleIndex”: 0}}’,headers, 10000)
Where
token = “Bearer dfsfdfssw”
When I execute code I’ve got:
An error occurred during the script execution: Could not invoke method:
org.eclipse.smarthome.model.script.actions.HTTP.sendHttpPostRequest(java.lang.String,java.lang.String,java.lang.String,int) on instance: null
I’ve read that there is a problem with sendHttpPost when we include Header. Is it true, if yes what is workaround?