I have selfhosted ntfy for push-messages, and i also want to use it with openhab.
This code works:
var headers={"Authorization": "Basic xxxxxxxxxxxxxxxx", "Content-Type": "application/json", "Title" : "openhAB", "Tags" : "+1, -1, warning"};
var url = "https://ntfy.xxxxxx.de/openhab"
var content = 'Hallo'
actions.HTTP.sendHttpPostRequest(url,"application/json", content,headers, 5000)
Now i tried to do it with Blockly:
The code looks very similar, but does not work:
var content, headers, url;
content = 'Hallo';
headers = '{"Authorization": "Basic xxxxxxxxxxxxxxxx", "Content-Type": "application/json", "Title" : "openhAB", "Tags" : "+1, -1, warning"}';
url = 'https://ntfy.xxxxxxx.de/openhab';
actions.HTTP.sendHttpPostRequest(url,"application/json", content,headers, 5000)
Only a few differences with ’ and ", but is there a way to do it right with blockly?
Thanks!