Content negotiation
Content negotiation is the HTTP process by which a client and server select a mutually supported representation format, language, or version.
The Design of Web APIs, Second Edition
HTTP content negotiation is the HTTP mechanism by which a client and server select an appropriate representation format or language for a message.
- How it is used
- Lets API consumers select useful response formats and languages while retaining a shared operation.
- How deep it goes
- Explains request and response headers, defaults, localization boundaries, and format trade-offs without detailing negotiation algorithms or unsupported-type responses.
- Examples
- Uses CSV transaction exports, XML money transfers, translated category labels, and summarized account representations.
- What you can do after
- Operate/configure it with Accept, Content-Type, and Accept-Language headers to choose supported representations without assuming input and output formats match.
Read how The Design of Web APIs, Second Edition explains content negotiation →
ASP.NET Core in Action, 3e
Content negotiation is the process by which an HTTP client and server select a representation format for a response based on supported media types and request preferences.
- How it is used
- Uses content negotiation to format web API controller responses for clients with different media-type needs.
- How deep it goes
- Explains header preferences, formatter defaults, XML registration, and configurable special cases, while deferring custom formatter creation.
- Examples
- Uses a car-list controller, weighted Accept header, XML formatter registration, and browser-header configuration.
- What you can do after
- Operate/configure ASP.NET Core controller formatters to support XML and adjust browser Accept-header handling.
Read how ASP.NET Core in Action, 3e explains content negotiation →
Pro ASP.NET Core 7, Tenth Edition
Content negotiation is the process of selecting a response representation by comparing client-specified format preferences with the formats an HTTP server can produce.
- How it is used
- Shapes ASP.NET Core web-service responses to match client-specified representation preferences.
- How deep it goes
- Explains Accept-header behavior, formatter registration, serialization constraints, fallback requests, and 406 handling.
- Examples
- Demonstrates PowerShell requests for XML, wildcard fallback, and PNG, with observed JSON, XML, and 406 responses.
- What you can do after
- Operate/configure ASP.NET Core MVC to add XML output, test Accept preferences, and control unsupported-format behavior.
Read how Pro ASP.NET Core 7, Tenth Edition explains content negotiation →
What to know first
- JSONJSON is a language-independent text-based data-interchange format that represents structured values using objects, arrays, strings, numbers, booleans, and null.
- HTTPHTTP is an application-layer protocol that defines request-and-response communication for transferring resource representations and related metadata between networked systems.
- MIME typeA MIME type, or media type, is a standardized identifier that specifies the format and nature of data, typically using a type and subtype separated by a slash.
- xmlXML (Extensible Markup Language) is a text-based markup language for representing structured information using elements, attributes, and nested relationships.
Related concepts
- Accept headeruses · An Accept header is an HTTP request header that specifies the media types a client can process in the response, optionally indicating preferences.
- Accept-Languageuses · Accept-Language is an HTTP request header that communicates the natural languages or language variants preferred or accepted by a client.
- controllerused by · A controller is a software component that receives input or requests and coordinates other components or operations to produce a response or change application state.
- operationused by · An operation is an action or computation performed on or by a system, object, or service that may produce a result or change state.
Questions about content negotiation
What is content negotiation?
Content negotiation is the HTTP process by which a client and server select a mutually supported representation format, language, or version.
Which Manning books explain content negotiation?
The Design of Web APIs, Second Edition, ASP.NET Core in Action, 3e and Pro ASP.NET Core 7, Tenth Edition.
What should I know before learning content negotiation?
Manning books that teach content negotiation usually introduce JSON, HTTP, MIME type and xml first.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


