Here is an example of how to pass a JSON that is nested with a HTTPBuilder
private def getWorkingLatitude(String additionalInfo)
{
def json = new JsonBuilder()
json {
"jobId" additionalInfo
"phoneList"{
"mobilePhone" "0123469521"
"homePhone" "01235698470"
}
}
return json;
}
Here is how you wrap it with HTTPBuilder
HTTP_BUILDER.request(Method.PUT, ContentType.JSON){
headers.'Authorization' = "Bearer "+ ACCESS_TOKEN_TM
uri.path = JOB_URI_PREFIX +USER_ID_TM+"/reject"
println "uri job is : "+uri.path
body = json.toString()
}