I want to use the response json of a GET request as an input to another request. For that the response that I receive should be in correct json format. I am using HttpBuilder to do this.
HTTPBuilder http = new HTTPBuilder(urlParam, ContentType.JSON);
http.headers.Accept = ContentType.JSON;
http.parser[ContentType.JSON] = http.parser.'application/json'
return http.request(GET) {
response.success = {resp, json ->
return json.toString()
}
When I return the json.toString() it is not a well formed json. How do I achieve that. When I click my get url i see entire json but not using the above code.Thanks for your help.