dbfrager
(David Frager)
February 13, 2016, 5:16pm
1
I am attempting to create my first SmartApp using web services
From the browser, the following command works:
https://192.168.1.81:8080/api/4/apiVer
when I attempt an HttpGet request from my app,I get a ConnectTimeoutException
def apiParams = [
uri: “https://192.168.1.81:8080 ”,
path: “/api/4/apiVer”,
]
log.debug "parm: " + apiParams
try {
httpGet(apiParams) { resp ->
resp.headers.each {
log.debug “${it.name} : ${it.value}”
}
log.debug “response contentType: ${resp. contentType}”
}
} catch (e) {
log.debug “something went wrong: $e”
}
Jim
(Jim Anderson)
February 13, 2016, 5:50pm
2
When I click that link the browser hangs on “connecting…”, and eventually resolves with ERR_CONNECTION_TIMED_OUT
, which would explain the timeout exception.
Terafin
February 13, 2016, 5:53pm
3
David,
If you take a look here: https://github.com/terafin/SmartThingsPublic/tree/master/devicetypes/terafin/airscape-whole-house-fan-controller.src
I have a simple local HTTP based device that (admittedly isn’t super clean), but works! I struggled getting it right for quite a while…
Let me know if that works out or not!
2 Likes
dbfrager:
httpGet(apiParams)
Don’t think that will work for local addresses… Check out sendHubCommand
3 Likes