HubAction "PUT" not working


(Rusty Phillips) #1

I have this bit of code in my smartapp:

def httpCall(body, ipAddress, mac, group) {

def path =  "/gateways/$mac/rgbw/$group"
try {
    def hubaction = new physicalgraph.device.HubAction([
        method: "PUT",
        path: path,
        body: body,
        headers: [ HOST: "$ipAddress:80", "Content-Type": "application/x-www-form-urlencoded" ]]
    )
    log.debug("Sending $bodyString to ${path}.")
    sendHubCommand(hubaction);
    return hubAction;
} catch (e) {
    log.error "Error sending: $e"
}

}

I notice that if I substitute “PUT” for “POST” or “GET” it works, but when I use “PUT” it does absolutely nothing. Doesn’t send at all. What am I doing wrong?