When trying to do asyncHttpPost I get responsecode 408. But using the same params but in a httpPost instead it works. What am I doing wrong?
def postParams = [
uri: "https://api.tibber.com/v1-beta/gql",
headers: ["Content-Type": "application/json;charset=UTF-8" , "Authorization": "Bearer $tibber_apikey"],
body: graphQLApiQuery()
]
This works:
httpPostJson(postParams) { resp ->
if(resp.status == 200){
log.debug "${resp.data}"
}
}
But this returns 408:
asynchttpPost('myCallbackMethod', postParams)
Callback function:
def myCallbackMethod(response, data)
{
log.debug("response.status = ${response.status}")
if(!response.hasError())
{
log.debug("response.getData() = ${response.getData()}")
}
}