@@ -1376,15 +1376,21 @@ Content-Type: text/plain
13761376
13771377<section title="Fields" anchor="fields">
13781378<iref primary="true" item="field"/>
1379+ <t>
1380+ HTTP uses "<x:dfn>fields</x:dfn>" to provide data in the form of extensible
1381+ key/value pairs with a registered key namespace. Fields are sent and
1382+ received within the header and trailer sections of messages
1383+ (<xref target="message.abstraction"/>).
1384+ </t>
13791385
13801386<section title="Field Names" anchor="field-names">
13811387 <x:anchor-alias value="header.names"/>
13821388 <x:anchor-alias value="field-name"/>
13831389<t>
1384- The field-name token labels the corresponding field value as having the
1385- semantics defined by that field . For example, the <x:ref>Date</x:ref>
1386- header field is defined in <xref target="field.date"/> as containing the origination
1387- timestamp for the message in which it appears.
1390+ A field name labels the corresponding field value as having the
1391+ semantics defined by that name . For example, the <x:ref>Date</x:ref>
1392+ header field is defined in <xref target="field.date"/> as containing the
1393+ origination timestamp for the message in which it appears.
13881394</t>
13891395<sourcecode type="abnf7230"><iref primary="true" item="Grammar" subitem="field-name"/>
13901396 <x:ref>field-name</x:ref> = <x:ref>token</x:ref>
@@ -1413,8 +1419,8 @@ Content-Type: text/plain
14131419 (<xref target="field.connection"/>) or the proxy is specifically
14141420 configured to block, or otherwise transform, such fields.
14151421 Other recipients &SHOULD; ignore unrecognized header and trailer fields.
1416- These requirements allow HTTP's functionality to be enhanced without
1417- requiring prior update of deployed intermediaries.
1422+ Adhering to these requirements allows HTTP's functionality to be extended
1423+ without updating or removing deployed intermediaries.
14181424</t>
14191425</section>
14201426
@@ -1423,19 +1429,20 @@ Content-Type: text/plain
14231429 <iref item="field line"/>
14241430 <iref item="field name"/>
14251431 <iref item="field line value"/>
1426- Both sections are composed of any number of "<x:dfn>field lines</x:dfn>",
1432+ Field sections are composed of any number of "<x:dfn>field lines</x:dfn>",
14271433 each with a "<x:dfn>field name</x:dfn>" (see <xref target="field-names"/>)
14281434 identifying the field, and a "<x:dfn>field line value</x:dfn>" that conveys
1429- data for the field.
1435+ data for that instance of the field.
14301436</t>
14311437<t>
14321438 <iref item="field value"/>
1433- Each field name present in a section has a corresponding "<x:dfn>field value</x:dfn>"
1434- for that section, composed from all field line values with that given
1435- field name in that section, concatenated together and separated with
1436- commas. See <xref target="field-order"/> for further discussion of the
1437- semantics of field ordering and combination in messages, and <xref
1438- target="field-values"/> for more discussion of field values.
1439+ When a field name is only present once in a section, the combined
1440+ "<x:dfn>field value</x:dfn>" for that field consists of the corresponding
1441+ field line value.
1442+ When a field name is repeated within a section, its combined field value
1443+ consists of the list of corresponding field line values within that section,
1444+ concatenated in order, with each non-empty field line value separated by a
1445+ comma.
14391446</t>
14401447<t>
14411448 For example, this section:
@@ -1452,10 +1459,11 @@ Content-Type: text/plain
14521459</t>
14531460</section>
14541461
1455- <section title="Field Ordering and Combination " anchor="field-order">
1462+ <section title="Field Order " anchor="field-order">
14561463 <x:anchor-alias value="header.order"/>
14571464<t>
1458- A recipient &MAY; combine multiple field lines within a field section that have the same field name
1465+ A recipient &MAY; combine multiple field lines within a field section that
1466+ have the same field name
14591467 into one field line, without changing the semantics of the message, by
14601468 appending each subsequent field line value to the initial field line value
14611469 in order, separated by a comma and <x:ref>OWS</x:ref> (optional whitespace).
@@ -1489,16 +1497,17 @@ Content-Type: text/plain
14891497 </t>
14901498</aside>
14911499<t>
1492- The order in which field lines with differing names are
1493- received in a message is not significant. However, it is good practice to send
1494- header fields that contain control data first, such as <x:ref>Host</x:ref>
1495- on requests and <x:ref>Date</x:ref> on responses, so that implementations
1496- can decide when not to handle a message as early as possible.
1500+ The order in which field lines with differing field names are received in a
1501+ section is not significant. However, it is good practice to send header
1502+ fields that contain additional control data first, such as
1503+ <x:ref>Host</x:ref> on requests and <x:ref>Date</x:ref> on responses, so
1504+ that implementations can decide when not to handle a message as early as
1505+ possible.
14971506</t>
14981507<t>
14991508 A server &MUST-NOT; apply a request to the target resource until the entire
1500- request header section is received, since later header field lines might include
1501- conditionals, authentication credentials, or deliberately misleading
1509+ request header section is received, since later header field lines might
1510+ include conditionals, authentication credentials, or deliberately misleading
15021511 duplicate header fields that would impact request processing.
15031512</t>
15041513</section>
@@ -1841,7 +1850,7 @@ Content-Type: text/plain
18411850 <x:anchor-alias value="parameters"/>
18421851 <x:anchor-alias value="parameter-name"/>
18431852 <x:anchor-alias value="parameter-value"/>
1844- Parameters are zero or more instances of a name=value pair ; they are often used in field
1853+ Parameters are instances of name=value pairs ; they are often used in field
18451854 values as a common syntax for appending auxiliary information to an item.
18461855 Each parameter is usually delimited by an immediately preceding semicolon.
18471856</t>
@@ -2015,24 +2024,57 @@ Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
20152024
20162025<section title="Message Abstraction" anchor="message.abstraction">
20172026<iref primary="true" item="message abstraction"/>
2018- <iref item="message"/>
2027+ <iref primary="true" item="message"/>
2028+ <iref primary="true" item="self-descriptive"/>
2029+ <t>
2030+ Each major version of HTTP defines its own syntax for communicating
2031+ messages. This section defines an abstract data type for HTTP messages
2032+ based on a generalization of those message characteristics, common structure,
2033+ and capacity for conveying semantics. This abstraction is used to define
2034+ requirements on senders and recipients that are independent of the HTTP
2035+ version, such that a message in one version can be relayed through other
2036+ versions without changing its meaning.
2037+ </t>
2038+ <t>
2039+ A <x:dfn>message</x:dfn> consists of control data to describe and route the
2040+ message, a headers lookup table of key/value pairs for extending that
2041+ control data and conveying additional information about the sender, message,
2042+ payload, or context, a potentially unbounded stream of payload data, and a
2043+ trailers lookup table of key/value pairs for communicating information
2044+ obtained while sending the payload.
2045+ </t>
20192046<t>
2020- Each major version of HTTP defines its own syntax for the communication of
2021- messages. However, they share a common data abstraction.
2047+ Framing and control data is sent first, followed by a header section
2048+ containing fields for the headers table. When a message includes a payload,
2049+ the payload data is sent after the header section and potentially
2050+ interleaved with zero or more trailer sections containing fields for the
2051+ trailers table.
20222052</t>
20232053<t>
2024- A message consists of control data to describe and route the message,
2025- optional header fields that modify or extend the message semantics,
2026- describe the sender, the payload, or provide additional context,
2027- a potentially unbounded stream of payload data, and optional
2028- trailer fields for metadata collected while sending the payload.
2054+ Messages are expected to be processed as a stream, wherein the purpose of
2055+ that stream and its continued processing is revealed while being read.
2056+ Hence, control data describes what the recipient needs to know immediately,
2057+ header fields describe what needs to be known before receiving a payload,
2058+ the payload (when present) presumably contains what the recipient wants or
2059+ needs to fulfill the message semantics, and trailer fields provide
2060+ additional metadata that can be dropped (safely ignored) when not desired.
20292061</t>
20302062<t>
2031- Messages are intended to be self-descriptive. This means that everything a
2032- recipient needs to know about the message can be determined by looking at
2033- the message itself, after decoding or reconstituting parts that have been
2034- compressed or elided in transit, without requiring an understanding of the
2035- sender's current application state (established via prior messages).
2063+ Messages are intended to be <x:dfn>self-descriptive</x:dfn>:
2064+ everything a recipient needs to know about the message can be determined by
2065+ looking at the message itself, after decoding or reconstituting parts that
2066+ have been compressed or elided in transit, without requiring an
2067+ understanding of the sender's current application state (established via
2068+ prior messages).
2069+ </t>
2070+ <t>
2071+ Note that this message abstraction is a generalization across many versions
2072+ of HTTP, including features that might not be found in some versions. For
2073+ example, trailers were introduced within the HTTP/1.1 chunked transfer
2074+ coding as a single trailer section at the end of the payload data. An
2075+ equivalent feature is present in HTTP/2 and HTTP/3 within the header block
2076+ that terminates each stream. However, multiple trailer sections interleaved
2077+ with payload data have only been deployed as frame extensions.
20362078</t>
20372079
20382080<section title="Framing and Completeness" anchor="message.framing">
@@ -2045,7 +2087,7 @@ Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
20452087</t>
20462088<t>
20472089 HTTP/0.9 and early deployments of HTTP/1.0 used closure of the underlying
2048- connection to end each response. For backwards compatibility, this implicit
2090+ connection to end a response. For backwards compatibility, this implicit
20492091 framing is also allowed in HTTP/1.1. However, implicit framing can fail to
20502092 distinguish an incomplete response if the connection closes early. For
20512093 that reason, almost all modern implementations use explicit framing in
@@ -2064,11 +2106,31 @@ Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
20642106<section title="Control Data" anchor="message.control.data">
20652107<iref primary="true" item="control data"/>
20662108<t>
2067- Every HTTP message has a protocol version. Depending on the version in use, it
2068- might be carried in the message explicitly, or it might be inferred by the
2069- connection that the message is carried on. A message can change versions as it
2070- passes through intermediaries, because the semantics of a HTTP message are
2071- independent of its version.
2109+ Messages start with control data that describe its primary purpose. Request
2110+ message control data includes a request method (<xref target="methods"/>),
2111+ request target (<xref target="request.target"/>), and protocol version
2112+ (<xref target="protocol.version"/>). Response message control data includes
2113+ a status code (<xref target="status.codes"/>), optional reason phrase, and
2114+ protocol version.
2115+ </t>
2116+ <t>
2117+ In HTTP/1.1 <xref target="Messaging"/> and earlier, control data is sent
2118+ as the first line of a message. In HTTP/2 (<xref target="RFC7540"/>) and
2119+ HTTP/3 (<xref target="HTTP3"/>), control data is sent as pseudo-header
2120+ fields with a reserved name prefix (e.g., ":authority").
2121+ </t>
2122+ <t>
2123+ Every HTTP message has a protocol version. Depending on the version in use,
2124+ it might be identified within the message explicitly or inferred by the
2125+ connection over which the message is received. Recipients use that version
2126+ information to determine limitations or potential for later communication
2127+ with that sender.
2128+ </t>
2129+ <t>
2130+ When a message is forwarded by an intermediary, the protocol version is
2131+ updated to reflect the version used by that intermediary.
2132+ The <x:ref>Via</x:ref> header field (<xref target="field.via"/>) is used to
2133+ communicate upstream protocol information within a forwarded message.
20722134</t>
20732135<t>
20742136 A client &SHOULD; send a request version equal to the highest
@@ -2106,22 +2168,24 @@ Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
21062168</section>
21072169
21082170<section title="Header Fields" anchor="header.fields">
2109- <t >
2171+ <iref primary="true" item="header section"/ >
21102172 <iref item="field"/>
2111- <iref item="section"/>
2112- HTTP messages use key/value pairs to convey data about the
2113- message, its payload, the target resource, or the connection.
2114- They are called "HTTP fields" or just "<x:dfn>fields</x:dfn>".
2115- Fields occur in groups called "<x:dfn>field sections</x:dfn>" or just "sections".
2173+ <t>
2174+ Fields (<xref target="fields"/>) that are sent/received before the payload
2175+ are referred to as "header fields" (or just "headers", colloquially).
21162176</t>
21172177<t>
2118- <iref item="header section"/>
2119- Fields that are sent/received before the payload data are referred to as
2120- "header fields" (or just "headers", colloquially) and are located within the
2121- "<x:dfn>header section</x:dfn>" of a message. We refer to some named fields
2122- specifically as a "header field" when they are only allowed to be sent in
2123- the header section.
2178+ The "<x:dfn>header section</x:dfn>" of a message consists of a sequence of
2179+ of header field lines. Each header field might modify or extend message
2180+ semantics, describe the sender, define the payload, or provide additional
2181+ context.
21242182</t>
2183+ <aside>
2184+ <t>
2185+ &Note; We refer to named fields specifically as a "header field" when they
2186+ are only allowed to be sent in the header section.
2187+ </t>
2188+ </aside>
21252189</section>
21262190
21272191<section title="Payload" anchor="payload">
@@ -2250,22 +2314,16 @@ Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
22502314</section>
22512315
22522316<section title="Trailer Fields" anchor="trailer.fields">
2253- <iref item="trailer fields"/>
2254- <iref item="trailers"/>
2255-
2256- <section title="Purpose" anchor="trailers.purpose">
2317+ <iref primary="true" item="trailer section"/>
2318+ <iref primary="true" item="trailer fields"/>
2319+ <iref primary="true" item="trailers"/>
22572320<t>
2258- <iref item="trailer section"/>
2259- Fields that are sent/received after the header
2260- section has ended (usually after the message body begins to stream) are
2321+ Fields (<xref target="fields"/>) that are sent/received after the header
2322+ section has ended (usually after the payload data begins to stream) are
22612323 referred to as "trailer fields" (or just "trailers", colloquially) and
22622324 located within a "<x:dfn>trailer section</x:dfn>".
2263- </t>
2264- <t>
2265- In some HTTP versions, additional
2266- metadata can be sent after the initial header section has been completed
2267- (during or after transmission of the payload body), such as a message
2268- integrity check, digital signature, or post-processing status.
2325+ Trailer fields can be useful for supplying message integrity checks, digital
2326+ signatures, delivery metrics, or post-processing status information.
22692327</t>
22702328<t>
22712329 Trailer fields ought to be processed and stored separately from the fields
@@ -2275,7 +2333,6 @@ Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
22752333 processing of the message as a whole before the trailers are received;
22762334 those choices cannot be unmade by the later discovery of trailer fields.
22772335</t>
2278- </section>
22792336
22802337<section title="Limitations on use of Trailers" anchor="trailers.limitations">
22812338<t>
@@ -12981,6 +13038,16 @@ transfer-coding = <transfer-coding, see <xref target="Messaging" x:fmt="," x:
1298113038 one or more trailing semicolons.
1298213039 (<xref target="parameter"/>)
1298313040</t>
13041+ <t>
13042+ An abstract data type for HTTP messages has been introduced to define the
13043+ components of a message and their semantics as an abstraction across
13044+ multiple HTTP versions, rather than in terms of the specific syntax form of
13045+ HTTP/1.1 in <xref target="Messaging"/>, and reflect the contents after the
13046+ message is parsed. This makes it easier to distinguish between requirements
13047+ on the payload data (what is conveyed) versus requirements on the messaging
13048+ syntax (how it is conveyed) and avoids baking limitations of early protocol
13049+ versions into the future of HTTP. (<xref target="message.abstraction"/>)
13050+ </t>
1298413051<t>
1298513052 The term "effective request URI" has been replaced with "target URI".
1298613053 (<xref target="target.resource"/>)
@@ -13352,6 +13419,7 @@ transfer-coding = <transfer-coding, see <xref target="Messaging" x:fmt="," x:
1335213419 <li>In <xref target="PUT"/>, clarify handling of unrecognized fields (<eref target="https://github.com/httpwg/http-core/issues/502"/>)</li>
1335313420 <li>In <xref target="status.1xx"/>, align language about bodies and trailers with 204 and 304 (<eref target="https://github.com/httpwg/http-core/issues/503"/>)</li>
1335413421 <li>Moved table of content codings into <xref target="content.coding.registration"/>, moved table of range units into <xref target="range.unit.registration"/> (<eref target="https://github.com/httpwg/http-core/issues/506"/>)</li>
13422+ <li>In <xref target="message.abstraction"/>, add an abstract data type for message to help define semantics without being dependent on the specific structure of HTTP/1.1 (<eref target="https://github.com/httpwg/http-core/issues/557"/>)</li>
1335513423 <li>In <xref target="lastmod.comparison"/>, relax arbitrary 60-second comparison limit (<eref target="https://github.com/httpwg/http-core/issues/510"/>)</li>
1335613424 <li>In <xref target="field.name.registration"/>, note that this document updates <xref target="RFC3864"/> (<eref target="https://github.com/httpwg/http-core/issues/515"/>)</li>
1335713425 <li>In <xref target="protection.space"/>, replace "canonical root URI" by "origin" (<eref target="https://github.com/httpwg/http-core/issues/542"/>)</li>
0 commit comments