Skip to main content

Content Negotiation

Learn Content Negotiation (Content Negotiation, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes Content negotiation is how the server and client agree on the representation of a resource, such as JSON or XML, for one URL. Strategies : Spring MVC looks at the Accept header first. Older options were a path extension or a query parameter, and the parameter strategy is still available if you enable it. Who does it : ContentNegotiationManager picks the media types, and an HttpMessageConverter writes the body.

More lessons in Content Negotiation