Accept header
An Accept header is an HTTP request header that specifies the media types a client can process in the response, optionally indicating preferences.
ASP.NET Core in Action, 3e
An Accept header is an HTTP request header that lists the media types a client can understand and may rank by preference.
- How it is used
- Uses client media-type preferences to select an HTTP API response representation.
- How deep it goes
- Explains MIME-type weighting, formatter selection, defaults, browser exceptions, and XML configuration, but defers custom formatter implementation.
- Examples
- Uses weighted JSON, XML, and plain-text preferences, plus browser requests, XML formatter configuration, and a cars-controller response.
- What you can do after
- Operate/configure ASP.NET Core controllers to request, produce, and troubleshoot JSON or XML response formats.
Read how ASP.NET Core in Action, 3e explains Accept header →
Pro ASP.NET Core 7, Tenth Edition
An Accept header is an HTTP request header that lists the media types a client is willing to receive in the response, optionally with relative quality preferences.
- How it is used
- Uses the Accept header to demonstrate how client format preferences affect ASP.NET Core MVC responses.
- How deep it goes
- Explains quality preferences and tests formatter behavior, including JSON fallback and XML setup, without descending into formatter internals.
- Examples
- Tests /api/content/object with PowerShell Accept headers and reads the Accept value through a controller parameter.
- What you can do after
- Operate/configure it by enabling XML formatting, testing response types, and constraining an action to JSON with Produces.
Read how Pro ASP.NET Core 7, Tenth Edition explains Accept header →
The Design of Web APIs, Second Edition
Accept is an HTTP request header that specifies the response media types a client can process.
- How it is used
- Uses HTTP content negotiation to let consumers select response formats suited to their tools, workflows, or interoperability needs.
- How deep it goes
- Explains optional defaults, response media types, independent request formats, hypermedia choices, and unsupported-format feedback.
- Examples
- Demonstrates CSV transaction responses, JSON and XML transfers, HAL and Siren responses, and 415 format guidance.
- What you can do after
- Apply it via HTTP content negotiation to request usable representations and distinguish desired responses from submitted request formats.
Read how The Design of Web APIs, Second Edition explains Accept header →
What to know first
- xmlXML (Extensible Markup Language) is a text-based markup language for representing structured information using elements, attributes, and nested relationships.
- HTTP status codeAn HTTP status code is a standardized three-digit code in an HTTP response that indicates the outcome of processing a request.
- JSONJSON is a language-independent text-based data-interchange format that represents structured values using objects, arrays, strings, numbers, booleans, and null.
- 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.
Related concepts
- content negotiationused by · Content negotiation is the HTTP process by which a client and server select a mutually supported representation format, language, or version.
- HTTP headerkind of · An HTTP header is a named field in an HTTP message that carries metadata or control information about the message, its content, or its processing.
- JSONconfigures · JSON is a language-independent text-based data-interchange format that represents structured values using objects, arrays, strings, numbers, booleans, and null.
Questions about Accept header
What is Accept header?
An Accept header is an HTTP request header that specifies the media types a client can process in the response, optionally indicating preferences.
Which Manning books explain Accept header?
ASP.NET Core in Action, 3e, Pro ASP.NET Core 7, Tenth Edition and The Design of Web APIs, Second Edition.
What should I know before learning Accept header?
Manning books that teach Accept header usually introduce xml, HTTP status code, JSON and MIME type first.
What is the difference between Accept header and FormatFilterAttribute?
An Accept header is an HTTP request header that specifies the media types a client can process in the response, optionally indicating preferences. FormatFilterAttribute is an ASP.NET Core MVC attribute that selects an action result's response format from a route value or query-string parameter.
What is Accept header a kind of?
Accept header is a kind of HTTP header. An HTTP header is a named field in an HTTP message that carries metadata or control information about the message, its content, or its processing.
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.


