Hi,
I try to get a CURL request running which is successful on terminal.
Here is the JS code:
var curl1 = 'curl -X POST -k -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Basic THERIGHTXXXXXAPIKEY" -d \'{"priority": "warning", "model": { "cycles": 1, "frames": [{ "icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAUklEQVQYlWNUVFBgYGBgYBC98uE/AxJ4rSPAyMDAwMCETRJZjAnGgOlAZote+fCfCV0nOmA0+yKAYTwygJuAzQoGBgYGRkUFBQZ0dyDzGQl5EwCTESNpFb6zEwAAAABJRU5ErkJggg==", "text": "HELLO!" } ], "sound": { "category": "notifications", "id": "cat" }}}\' https://192.168.13.161:4343/api/v2/device/notifications';
var response1 = actions.Exec.executeCommandLine(Duration.ofSeconds(5), curl1);
console.info('Test send ' + response1);
And this is the error message - for me it says nothing…
==> /var/log/openhab/openhab.log <==
2023-04-13 21:57:24.853 [WARN ] [rg.openhab.core.io.net.exec.ExecUtil] - Failed to execute commandLine '[curl -X POST -k -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Basic THERIGHTXXXXXAPIKEY" -d '{"priority": "warning", "model": { "cycles": 1, "frames": [{ "icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAUklEQVQYlWNUVFBgYGBgYBC98uE/AxJ4rSPAyMDAwMCETRJZjAnGgOlAZote+fCfCV0nOmA0+yKAYTwygJuAzQoGBgYGRkUFBQZ0dyDzGQl5EwCTESNpFb6zEwAAAABJRU5ErkJggg==", "text": "HELLO!" } ], "sound": { "category": "notifications", "id": "cat" }}}' https://192.168.13.161:4343/api/v2/device/notifications]'
2023-04-13 21:57:24.877 [INFO ] [nhab.automation.script.ui.cf085708a0] - Test send null
Help very appreciated. I tried this (and other ways like sendHttpPostRequest) for multiple hours now and do not have any ideas left…
Thanks in advance!
HFM