Rule Machine HTTP GET Request with basic authentication

Trying to pass a simple command to to reboot a camera using RM http Get request:

http://usr:pw@IP/cgi-bin/web.fcgi?func=set{“system”:{“system_control”:“system_reboot”}}

[usr, pw and IP are placeholders]

The url works as expected via Chrome, but no response with Hubitat.

I think it is related to how RM handles basic authentication in the url.

Is there any simple work around this or another app that would work for this?

Here is what I get back:

app:64 2024-09-02 20:58:36.86 error java.net.URISyntaxException: Illegal character in query at index 58: http://usr:pw@IP/cgi-bin/web.fcgi?func=set{“system”:{“system_control”:“system_reboot”}} on line 7112 (method appButtonHandler)

Not sure why there is a reference to "appButtonHandler"

Also, as it turns out index 58 fall on the first { character.

Got it working...
Needed to do two things:

  1. Pass the url as a variable
  2. In the variable replace all special characters in the url, including {, }, and ", with %7B, %7D, and %22 respectively.

Quite a pain, but working

2 Likes