It might be that response or expression itself gets wrongly interpreted because of qutoing. Try increasing log verbosibility and see if you will get any pointers why it fails.
You can do that from console: log: set DEBUG org.openhab.core.transform.internal.service
Since your code is executed inside rule you can also try to capture exception (via try/catch closures):
try {
transform(...);
} catch (Exception e) {
logError("Error while processing response", e);
// eventually you can inspect e.getCause()
}
Thanks for responding.
Yes, Iāve noticed that the url can return both xml and json. Thatās why I print the returned format to see what Iām actually working with. The header info could for sure be controlling the format returned, but I do not think that this is the problem at hand. However, it could be an opportunity to do the transformation with xml/xpath instead.
@Confectrician
I found that I can get json if the request header parameter Accept = application/json and xml if Accept = application/xml. Thanks for the tip. Iāll investigate if itās easier using xpath.