We have two Microservice Services1 and Service2. In Service1 we have one PostMapping and return boolean value as below.
@PostMapping
public boolean reset(){
return true
}
When consume from Service2 through restTemplate exchange method it will return in XML format as below.
boolean val = restTemplate.exchange(url, Post method, http entity with header, Boolean.class);
Output
<boolean>true</boolean>
we expecting in JSON format in resttemplate call and if try through postman it will return in JSON.