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.
Questions tagged [content-negotiation]
184 questions
0
votes
0 answers
Asp.net WebApi supports json, xml, jsonp?
This question is specific to Asp.Net WebApi.
In my global file, I've put:
GlobalConfiguration.Configuration.Formatters.Clear();
GlobalConfiguration.Configuration.Formatters.Add(new JsonpMediaTypeFormatter());
JsonpMediaTypeFormatter is custom Jsonp…

SCV
- 1
- 2
-1
votes
1 answer
Ignore accept header in Spring REST WS
I have something like this:
@RestController
public class MyController {
@GetMapping("/myAddress")
public Response generateReportAsync(...) {
...
}
}
This web service generates a report file according to the Accept header…

Aurasphere
- 3,841
- 12
- 44
- 71
-2
votes
1 answer
Jackson api with JAX-RS to respond different versions of object model in content negotiation model of resource versioning
I need to provide a different version of response object for the same existing URI. I am going with Accept/Content-type conneg methodologies. I am using Jackson to covert my POJO into json. please help me how should i do it with jackson.
for the…

Deepak Kumar
- 1
- 1
- 1
-3
votes
3 answers
Make schemaless json serializable by web api
I have a JSON string that contains an object that is complex, nested, and will likely change schema in the future. I would like to hand it off to a web API to serialize in the content negotiation pipeline as needed.
Is there any straightforward way…

George Mauer
- 117,483
- 131
- 382
- 612