Thank you for your response, unfortunately I get following log:
I have a textbased JS rule, implemented by the rule builder (rules.JSRule({…}))
Do I need to import some library?
ReferenceError: "sendHttpGetRequest" is not defined: ReferenceError: "sendHttpGetRequest" is not defined
Basically, I call the requests in my JS rules the same way as you.
Since passing username and password in the URL is generally not recommended, I would try passing them in the header using Basic authentication.
HTTP.sendHttpGetRequest(String url, Map<String, String> headers, int timeout)
Example:
var header = new Map();
header.set("Authorization", "username:password");
header.set("Accept", "application/json");
...
If special characters are included in the username or password you must Base64 encode “username:password”
@uk59821 might be on the right track here. Using basic auth the way you are has been deprectated and considered bad practice for quite some years. It might be the case that Java 17 no longer supports that.
I’m all but certain there has been nothing done in OH itself that impacts this and the exception is comming from the underlying Java library, not OH in this case.
@Baschtlwaschtl I think it assuming Rules DSL. The code as shown could be either so it’s an understandable mistake. Please always mention what langauge you are using when posting code fragments unless it’s absolutely positively obvious what language it is
But the short of it is you do need the actions.HTTP in JS.