Executing this code:
def myFunc(success) {
httpGet(url, success)
}
...where "success" is a closure; but I'm getting:
groovy.lang.MissingMethodException: No signature of method: dev1532970113776849772051.httpGet() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl, dev1532970113776849772051$_getSession_closure3) values: [url, ...] on line 177 (poll)
The same works fine on ST; I suppose in Hubitat httpGet doesn't support closures?
BTW, I should mention that this is in the context of a device handler.
I'm curious, what does that actually do on smartthings? you are not passing anything for the first paramter of the call to httpGet, so you are not telling it what url to get.
the signature for httpGet is: void httpGet(Map parameters, Closure closure)
Sorry; I entered anglebracket url anglebracket, and the forum software stripped it; I corrected it now to avoid angle brackets... The first argument is indeed a valid URI.
Ah, ok, thanks, that makes more sense! We are indeed missing that method from our implementation:
void httpGet(String url, Closure closure)
In the meantime until we fix that, you can change your code to:
def myFunc(success) {
httpGet([uri:"YOUR URL"], success)
}
Perfect; works fine. Thanks!
httpGet(String, Closure) has been added in release 1.1.2
1 Like