I\'m working on a Spring MVC project and one of the tasks I need to do requires me to have a string of JSON data sent through by the user in a POST request. I know that Spri
We had a situation where we wanted some controller methods to map the POST body to beans, and other methods where we just wanted the raw String. To accomplish this using the @RequestBody annotation, you need to configure multiple message converters, something like...
Then, requests to the various methods must specify the "content-type" header with an appropriate value. For those methods where the request body is mapped to a JAXB bean, specify "application/xml". And for those where the request body is a String, use "text/plain".