Multiple scenarios @RequestMapping produces JSON/XML together with Accept or ResponseEntity
Using Accept header is really easy to get the format json or xml from the REST service. This is my Controller, take a look produces section. @RequestMapping(value = “properties”, produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE}, method = RequestMethod.GET) public UIProperty getProperties() { return uiProperty; } In order to consume the REST service we can use the code … Read more