I’ve searched and searched and couldn’t find an answer (many potential answers were from 2014/2015, but didn’t exactly fit the bill). Hoping this is an easy fix.
I’m trying to send a local lan HTTP Post to a destination behind my router inside a SmartApp (NOT a device). My code is:
hubGet("/ControllerName.json") // inside initialize, and yes, I realize I've hard-coded it below. :)
private hubGet(def apiCommand) {
def result = new physicalgraph.device.HubAction(
method: "POST",
path: "/ControllerName.json",
headers: [
"HOST" : "11.11.11.13:80",
"Accept":"application/json"
]
)
log.debug result.toString()
sendHubCommand(result);
}
and I’ve tried to subscribe with
subscribe(location, null, parse, [filterEvents:false])
and my parse function is
def parse(description) {
log.debug "in parse"
def msg = parseLanMessage(description)
}
I’ve also tried other combinations with no luck. After a while, I resorted to WireShark and noticed I never see any requests to 11.11.11.13, so something is clearly wrong with my sendHubCommand parameters.
Using CURL
curl -X POST 11.11.11.13/ControllerName.json
gives me a JSON response object. Why am I not seeing any activity on my local network? I’m new to ST, so thanks for the help!