Visual RFC.
ALL RFCs / RFC 9110
Read the RFC ↗
RFC 9110 / WEB FOUNDATIONS

HTTP headers: labels that change the outcome

03

Attach labels to a message, then watch a reader choose a format, count bytes, save a copy, check a version or decide who may read it.

RFC 9110 · § 5EXAMPLE
1 / 5 · Choose what the message needs

Start with the content and the reader’s goal.

Send the word Sun with a label that explains what it is.

Example contentSun

Choose an example below, then use Next to follow the labels.

Change the labels

Changing an input returns to the beginning. Restart restores this story’s original choices.

These examples stay on this page. No requests, credentials or cookies are sent or stored. The selected server policies are stated; real implementations need the complete field rules. Space plays or pauses; Next, Previous and Restart follow the active scene.

Find a header by its job · 35 selected fields

are named labels separate from content. This is a curated starting map, not every registered header. Headers live in several standards. Open a field’s source for its full syntax, direction and limits.

Field and sourceJobWhat it means
Content-Type ↗
Content descriptionNames the format of this content. It does not convert the bytes.
Content-Length ↗
Content descriptionCounts content octets, with special rules for HEAD, 304 and replies with no content.
Content-Encoding ↗
Content descriptionNames a coding such as gzip already applied to the representation.
Content-Language ↗
Content descriptionIdentifies the intended audience’s language, not necessarily every language present.
Content-Disposition ↗
Content handlingCan suggest inline display or attachment handling and a filename.
Accept ↗
Request preferenceLists acceptable response media types; selection is still the server’s job.
Accept-Language ↗
Request preferenceExpresses preferred audience languages.
Accept-Encoding ↗
Request preferenceExpresses acceptable content codings.
Vary ↗
Saved response selectionNames request fields that helped select the response.
Cache-Control ↗
Saving and reuseCarries cache directives; no-cache and no-store do different jobs.
Age ↗
Saving and reuseEstimates seconds since the response was generated or successfully validated.
Date ↗
Saving and reuseGives the message’s origination date and time.
Expires ↗
Saving and reuseGives a freshness expiry time; applicable max-age overrides it.
ETag ↗
Comparing versionsAn opaque representation tag; do not infer a timestamp or hash from its spelling.
Last-Modified ↗
Comparing versionsReports when the origin believes the representation was last modified.
If-None-Match ↗
Request conditionGET can avoid transferring matching content; other methods have different outcomes.
If-Match ↗
Request conditionRequires a strong matching tag before applying the method.
If-Modified-Since ↗
Request conditionA time-based conditional GET or HEAD.
Authorization ↗
CredentialCarries credentials for origin authentication; not a permission guarantee.
WWW-Authenticate ↗
CredentialDescribes an origin authentication challenge.
Cookie ↗
StateSends selected stored cookie name/value pairs to a server.
Set-Cookie ↗
StateAsks the browser to store one cookie with scope and attributes. Keep separate field lines.
Location ↗
Follow-upIdentifies a resource related to a response; its role depends on the status and method.
Retry-After ↗
Follow-upSuggests a delay or time before a follow-up; does not promise success.
Allow ↗
CapabilitiesLists methods supported by this target; does not grant permission.
Range ↗
Partial contentRequests part of a representation; the server can ignore it.
Content-Range ↗
Partial contentDescribes the returned interval and possibly the whole size.
Connection ↗
HTTP/1.1 forwardingIdentifies options for this connection; nominated fields are removed before forwarding.
Via ↗
ForwardingRecords intermediary protocol recipients.
Host ↗
RoutingCarries target authority information; not a user identity.
Origin ↗
Browser sharingIdentifies the request’s origin in CORS exchanges.
Access-Control-Allow-Origin ↗
Browser sharingControls which requesting origins can read a CORS response.
Access-Control-Allow-Credentials ↗
Browser sharingThe value true permits sharing when credentials mode is include, subject to other checks.
Strict-Transport-Security ↗
Browser policyAn HTTPS response can tell the browser to use HTTPS for later visits.
Content-Security-Policy ↗
Browser policyRestricts what a protected document may load or execute.

Explore CSP directives ↗ · MDN · broader header reference ↗ · IANA · registered HTTP fields ↗

Names are case-insensitive, but values follow each field’s own rules. Do not blindly comma-join repeated fields: Set-Cookie is a familiar exception. These decoded sketches are not complete wire messages. HTTP/2 and HTTP/3 use lowercase field names and binary framing; HTTP/1.1 line formatting is not universal. Browsers control some fields rather than allowing page code to set them freely.

3 / 3
03
Read the content correctly.

The client uses metadata rather than guessing the meaning of arbitrary bytes.

HTTP headers: labels that change the outcomeA resource has HTML and JSON variants; selected content is accompanied by its media type, content coding, and validator.A representation carries metadataOne resource can have multiple forms/guideHTMLtext/htmlJSONapplication/jsonselectedSelected representationContent-Type: application/jsonContent-Encoding: gzipETag: "guide-7"Decode gzip, then interpret JSONDecode and interpret using the metadata

Key idea: Headers are named labels sent with a message. Each field has its own meaning; the content is a separate part.

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.
Metadata
Information describing content, such as its type, language or encoding.
Content-Type
A field naming the format of the content, such as text/html.
Content-Encoding
A field describing a coding applied to the representation, such as gzip compression.
Content-Length
A field expressing a length in bytes under HTTP’s message rules.
Trailer
A field sent after the content, subject to restrictions.
media type
A format label telling a reader how content is meant to be interpreted.
charset
A label identifying the rules used to turn text characters into bytes and back.
content coding
A reversible way of transforming representation data for transfer or storage.
gzip
A format for packing data using compression so it can be unpacked later.
CSRF
An attack that tricks a browser into sending an unwanted request using the victim’s existing access.
Content-Language
Identifies the intended audience’s language, not necessarily every language present.
Content-Disposition
Can suggest inline display or attachment handling and a filename.
Accept
Lists acceptable response media types; selection is still the server’s job.
Accept-Language
Expresses preferred audience languages.
Accept-Encoding
Expresses acceptable content codings.
Vary
Names request fields that helped select the response.
Cache-Control
Carries cache directives; no-cache and no-store do different jobs.
Age field
Estimates seconds since the response was generated or successfully validated.
Date field
Gives the message’s origination date and time.
Expires field
Gives a freshness expiry time; applicable max-age overrides it.
ETag
An opaque representation tag; do not infer a timestamp or hash from its spelling.
Last-Modified
Reports when the origin believes the representation was last modified.
If-None-Match
GET can avoid transferring matching content; other methods have different outcomes.
If-Match
Requires a strong matching tag before applying the method.
If-Modified-Since
A time-based conditional GET or HEAD.
Authorization field
Carries credentials for origin authentication; not a permission guarantee.
WWW-Authenticate
Describes an origin authentication challenge.
Cookie field
Sends selected stored cookie name/value pairs to a server.
Set-Cookie
Asks the browser to store one cookie with scope and attributes. Keep separate field lines.
Location
Identifies a resource related to a response; its role depends on the status and method.
Retry-After
Suggests a delay or time before a follow-up; does not promise success.
Allow field
Lists methods supported by this target; does not grant permission.
Range field
Requests part of a representation; the server can ignore it.
Content-Range
Describes the returned interval and possibly the whole size.
Connection field
Identifies options for this connection; nominated fields are removed before forwarding.
Via field
Records intermediary protocol recipients.
Host field
Carries target authority information; not a user identity.
Origin field
Identifies the request’s origin in CORS exchanges.
Access-Control-Allow-Origin
Controls which requesting origins can read a CORS response.
Access-Control-Allow-Credentials
The value true permits sharing when credentials mode is include, subject to other checks.
Strict-Transport-Security
An HTTPS response can tell the browser to use HTTPS for later visits.
Content-Security-Policy
Restricts what a protected document may load or execute.
header field
A named piece of information sent with a request or response, separate from its content.
field name
The part of a message label that identifies which rule its value follows.
field value
The information attached to one named message label.
private cache
A saved-response store intended for one user, such as a browser’s HTTP cache.
current age
An estimate of how many seconds old a saved response is now.
no-cache
A cache instruction that requires successful checking before a saved response can be reused.
no-store
A cache instruction saying not to save this request and response for later cache reuse.
opaque tag
A comparison label whose internal spelling the receiver should not interpret.
HttpOnly
A cookie attribute that hides that cookie from ordinary page-script cookie access.
credentials mode
A Fetch setting controlling credential use and the rules for sharing a response with page code.
preflight
A browser permission check sent before certain cross-origin requests.
octet
One eight-bit byte: a small unit used to count or carry data.

Look up a term in the glossary ↗

Rules & examples
  • Content-Type identifies the media type; Content-Encoding describes representation codings.
  • Content-Length must agree with its defined meaning and framing constraints.
  • Field names are case-insensitive; trailers have additional restrictions on permitted use and merging.

These decoded sketches show selected fields, not full wire messages. Server choices, cache state, cookie scope and credential checks are explicit offline examples. No real cookies or requests are created. Browser sharing checks do not replace server permission checks. A curated field map links the full standards.

Predict: Does Cache-Control: no-cache mean a browser cannot save the response?

Check your answer

No. Unqualified no-cache permits storage but requires successful validation before reuse. no-store prohibits storing this request and response for later cache reuse.

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.

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 ↗