I have a @RestController
with the following method
@RequestMapping(path = "/thing", method = RequestMethod.GET,
produces = { MediaType.APPLICATION_XML_VALUE })
public List<Thing> listThings() {
return thingMapper.listThings();
}
But when I make a GET request with Accept:application/xml
in the header, the Content-Length of the response is 0 and it doesn't produce anything. I know that data is being returned by my query and if I remove the produces
attribute and make a plain get request it returns the data as json....I just cant get it to produce xml. Any ideas?
EDIT: I should mention that I am using the Spring Boot web starter