Suggest to use getBodyContent() and how to replace parameterized value in getBodyContent /?. There was method called replace() earlier which not working with getBodyContent.
public String getResponseBodyContent()
Get the response body content as a String
throws:
Exception if errors happened
Returns:
the response body content as a String
getResponseBodyContent will return a string. Parse it with jsonSlurper into a map, apply any substitution you like, than rebuild the json with jsonOutput.
Or, simply use any method you like for substitution in a string (regex based etc)