Pre-requisite: Add the below dependency in your Maven.
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180130</version>
</dependency>
Say you have a post response body in the string format response.getBody().asString() from the first request as below,
{
"id": 13245,
"name": "firstName",
"phone": 1234567890
}
Convert the above string to a JSONObject and manipulate data as below
JSONObject jsonObject = new JSONObject(response.getBody().asString());
jsonObject.put("id", 54321);
jsonObject.put("name", "lastName");
System.out.println(jsonObject.toString());
Your output will print as following
{"phone":1234567890,"name":"lastName","id":54321}