While we strive to not break anything with updates, in release 1.1.2 we have made a change to httpPost that may cause an issue.
We discovered that that method was not following the same pattern that httpGet, httpPut, etc use. As such, we updated the httpPost call to follow the same pattern and that may lead to changes necessary in your code.
With this new change, you must have a try/catch around the httpPost because it will throw an exception if the response code is greater than 400. In addition you may have to add a contentType and/or requestContentType parameter if you see an issue with your call. Please let us know if you see an error that is not fixed by the above changes.
groovy.lang.MissingMethodException: No signature of method: com.hubitat.hub.executor.AppExecutor.error() is applicable for argument types: (java.lang.String, java.lang.IllegalArgumentException) values: [Error logging in to AT&T, java.lang.IllegalArgumentException: No encoder found for request content type /] Possible solutions: render(), getLog(), now(), iterator(), grep(), every() on line 486 (prefATTConfirm)
Here is my code:
response.getHeaders('Set-Cookie').each {
def cookie = it.value.split(';')[0]
if (!cookie.startsWith('PD_')) cookies.push(cookie)
c = c + cookie + '; '
}
//using the cookies, retrieve the auth tokens
return httpPost([
uri: "https://my-digitallife.att.com/penguin/api/authtokens",
headers: [
"Referer": "https://my-digitallife.att.com/dl",
"contentType": "application/json",
"requestContentType": "application/x-www-form-urlencoded",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36",
"DNT": "1",
"Cookie": c
],
body: "domain=DL&appKey=TI_3198CF46D58D3AFD_001"
]) { response2 ->