Problem making uri call


(Bill Brazeal) #1

I am trying to make a call from a smart app to a website url without success. I know the url works because I can enter it in a browser with success. However, it does require a userid and password to be prepended to the website address due to the site having security credentials enabled. The url that works is as follows --> http://admin:password@192.168.0.xxx/api/HomeAutomation.HomeGenie/Automation/Programs.Run/1061

Can someone tell me how to get this working???

The code that I am trying to use is as follows:

private sendCmd(){
def params = [
uri: “http://admin:password@192.168.0.xxx/api/HomeAutomation.HomeGenie/Automation/Programs.Run/1061
]

try {
    httpPostJson(params) { resp ->
        resp.headers.each {
            log.debug "${it.name} : ${it.value}"
        }
        log.debug "response contentType: ${resp.    contentType}"
    }
} catch (e) {
    log.debug "something went wrong: $e"
}

}