Visual RFC.
ALL RFCs / RFC 9110
Read the RFC ↗
RFC 9110 / REQUEST DECISIONS

Content negotiation

05

The caller can express preferences for media type, language, or coding; the server chooses a representation.

RFC 9110 · § 12EXAMPLE
4 / 4
04
Return the chosen representation.

The response metadata describes what actually arrived.

Content negotiationAccept preferences select the JSON representation from a stack of variants, and Vary makes the selection inputs visible to a cache.Choose a useful representationIllustrative request and available variantsClient preferencesAccept: application/jsonHTMLtext/htmlJSONapplication/jsonTexttext/plainselectedVary: AcceptReturn JSON with Content-Type metadataReturn the chosen representation

Key idea: Negotiate a representation and describe the choice.

Terms
Client / user agent
The app making a request; in this example, your browser.
Origin server
The server responsible for providing an answer for the target resource.
Request
A message asking for an action on a resource.
Response
The server’s message reporting the result of a request.
Resource
Something identified by a URI, such as the page at /story.
Representation
Content and descriptive information that convey a resource’s state, such as an HTML page.
Semantics
What a message or protocol element means, independently of how it travels.
Content negotiation
Choosing a representation using preferences and available alternatives.
Accept
A request field listing preferred media types.
q value
A relative preference weight; it does not guarantee the server’s choice.
Vary
A response field identifying request fields that influenced representation selection.

Look up a term in the glossary ↗

Rules & examples
  • Accept, Accept-Language, and Accept-Encoding express client preferences; q values express relative weights.
  • Proactive negotiation selects before the response; reactive negotiation offers choices for a later request.
  • Vary identifies request fields that influenced selection so caches can distinguish variants.

Preferences do not guarantee a particular result. The server can sometimes disregard them or return a negotiation failure. Accept-Charset is deprecated.

Predict: Does Accept guarantee that the server will return your preferred format?

Check your answer

No. Preferences guide selection; they do not guarantee a particular result.

Sources
Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
New to this? Start hereA quick picture + helpful background

A request starts a conversation.

A client asks for a resource. A server sends a response. The method, address, headers, and status explain what that conversation means.

Helpful first, if these ideas are unfamiliar

These pictures are analogies to help you learn. The linked RFC explains the actual rules.

Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

What changed
RFC 7231 §5.3.3RFC 9110 §12.5.2

Accept-Charset is now deprecated. Appendix B.3 lists this change; senders should not use it as a modern charset-negotiation mechanism.

Read the updated RFC section ↗
EXPLORE THIS PROTOCOL

HTTP versions

HTTP semantics apply across versions. HTTP/2 and HTTP/3 change how messages travel; all three guides remain relevant.

All chapters in RFC 9110

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗