Top "Content-negotiation" questions

Content negotiation is a mechanism defined in the HTTP specification that makes it possible to serve different versions of a document (or more generally, a resource representation) at the same URI, so that user agents can specify which version fit their capabilities the best.

HTTP Accept Header meaning

When a browser's Accept request header says something like the following: Accept: application/xml,application/xhtml+xml,text/html;q=0.9,…

http http-headers mime-types content-negotiation
How to set the default content type in Spring MVC in no Accept header is provided?

If a request is sent to my API without an Accept header, I want to make JSON the default format. …

http rest spring-mvc content-negotiation
Accept Language list

I would like to react to the Accept_Language that a browser sends to a website. Does anybody know where …

content-negotiation http-accept-language
Spring 3.2 content negotiation class cast exception

We develop a standard Java web application using Spring MVC, and have recently tried to upgrade from 3.0.6 to 3.2.0. Nearly of …

spring spring-mvc content-negotiation
Same/different DTO object in create, update and get rest end points?

Consider following UserDTO class and UserController exposing endpoints to create, update and get User. Having the id property in the …

java rest spring-mvc dto content-negotiation
Content negotiation to return HTML

After reading this blog post on how to return HTML from Web API 2 using IHttpActionResult, I wanted to somehow "wire-up" …

c# html asp.net-web-api content-negotiation
Specify supported media types when sending "415 unsupported media type"

If a clients sends data in an unsupported media type to a HTTP server, the server answers with status "415 unsupported …

http rest http-status-codes httpresponse content-negotiation
What should be the return type of WEB API Action Method?

I am developing ASP.NET Web API using .NET Core. This Web API is going to be mainly accessed by …

asp.net-core asp.net-web-api2 content-negotiation
How to configure custom MediaType in Spring MVC?

Using Spring MVC, I have controllers already working for both JSON and XML media formats. In the content negotiation configuration, …

xml json spring spring-mvc content-negotiation
How to get a response from the Nancy Negotiator?

I have a NancyContext and I need to get a Response with a body based on the correct content negotiator …

c# nancy content-negotiation