| Internet Engineering Task Force (IETF) | R. Fielding, Editor |
| Request for Comments: 9110 | Adobe |
| Obsoletes: 2818, 7230, 7231, 7232, 7233, 7235, 7538, 7615, 7694 | M. Nottingham, Editor |
| STD: 97 | Fastly |
| Updates: 3864 | J. Reschke, Editor |
| Category: Standards Track | greenbytes |
| ISSN: 2070-1721 | June 2022 |
HTTP Semantics
Abstract
The Hypertext Transfer Protocol (HTTP) is a stateless application-level protocol for distributed, collaborative, hypertext information systems. This document describes the overall architecture of HTTP, establishes common terminology, and defines aspects of the protocol that are shared by all versions. In this definition are core protocol elements, extensibility mechanisms, and the "http" and "https" Uniform Resource Identifier (URI) schemes.
This document updates RFC 3864 and obsoletes RFCs 2818, 7231, 7232, 7233, 7235, 7538, 7615, 7694, and portions of 7230.
Status of This Memo
This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.
Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at https://www.rfc-editor.org/info/rfc9110.
Copyright Notice
Copyright (c) 2022 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.
This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The person(s) controlling the copyright in some of this material may not have granted the IETF Trust the right to allow modifications of such material outside the IETF Standards Process. Without obtaining an adequate license from the person(s) controlling the copyright in such materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process, except to format it for publication as an RFC or to translate it into languages other than English.
- 1. Introduction
- 2. Conformance
- 3. Terminology and Core Concepts
- 4. Identifiers in HTTP
- 5. Fields
- 6. Message Abstraction
- 7. Routing HTTP Messages
- 8. Representation Data and Metadata
- 9. Methods
- 10. Message Context
- 11. HTTP Authentication
- 12. Content Negotiation
- 13. Conditional Requests
- 14. Range Requests
- 15. Status Codes
- 15.1. Overview of Status Codes
- 15.2. Informational 1xx
- 15.3. Successful 2xx
- 15.4. Redirection 3xx
- 15.5. Client Error 4xx
- 15.5.1. 400 Bad Request
- 15.5.2. 401 Unauthorized
- 15.5.3. 402 Payment Required
- 15.5.4. 403 Forbidden
- 15.5.5. 404 Not Found
- 15.5.6. 405 Method Not Allowed
- 15.5.7. 406 Not Acceptable
- 15.5.8. 407 Proxy Authentication Required
- 15.5.9. 408 Request Timeout
- 15.5.10. 409 Conflict
- 15.5.11. 410 Gone
- 15.5.12. 411 Length Required
- 15.5.13. 412 Precondition Failed
- 15.5.14. 413 Content Too Large
- 15.5.15. 414 URI Too Long
- 15.5.16. 415 Unsupported Media Type
- 15.5.17. 416 Range Not Satisfiable
- 15.5.18. 417 Expectation Failed
- 15.5.19. 418 (Unused)
- 15.5.20. 421 Misdirected Request
- 15.5.21. 422 Unprocessable Content
- 15.5.22. 426 Upgrade Required
- 15.6. Server Error 5xx
- 16. Extending HTTP
- 17. Security Considerations
- 17.1. Establishing Authority
- 17.2. Risks of Intermediaries
- 17.3. Attacks Based on File and Path Names
- 17.4. Attacks Based on Command, Code, or Query Injection
- 17.5. Attacks via Protocol Element Length
- 17.6. Attacks Using Shared-Dictionary Compression
- 17.7. Disclosure of Personal Information
- 17.8. Privacy of Server Log Information
- 17.9. Disclosure of Sensitive Information in URIs
- 17.10. Application Handling of Field Names
- 17.11. Disclosure of Fragment after Redirects
- 17.12. Disclosure of Product Information
- 17.13. Browser Fingerprinting
- 17.14. Validator Retention
- 17.15. Denial-of-Service Attacks Using Range
- 17.16. Authentication Considerations
- 18. IANA Considerations
- 18.1. URI Scheme Registration
- 18.2. Method Registration
- 18.3. Status Code Registration
- 18.4. Field Name Registration
- 18.5. Authentication Scheme Registration
- 18.6. Content Coding Registration
- 18.7. Range Unit Registration
- 18.8. Media Type Registration
- 18.9. Port Registration
- 18.10. Upgrade Token Registration
- 19. References
- Appendix A. Collected ABNF
- Appendix B. Changes from Previous RFCs
- Acknowledgements
- Index
- Authors' Addresses
1. Introduction
1.1. Purpose
The Hypertext Transfer Protocol (HTTP) is a family of stateless, application-level, request/response protocols that share a generic interface, extensible semantics, and self-descriptive messages to enable flexible interaction with network-based hypertext information systems.
HTTP hides the details of how a service is implemented by presenting a uniform interface to clients that is independent of the types of resources provided. Likewise, servers do not need to be aware of each client's purpose: a request can be considered in isolation rather than being associated with a specific type of client or a predetermined sequence of application steps. This allows general-purpose implementations to be used effectively in many different contexts, reduces interaction complexity, and enables independent evolution over time.
HTTP is also designed for use as an intermediation protocol, wherein proxies and gateways can translate non-HTTP information systems into a more generic interface.
One consequence of this flexibility is that the protocol cannot be defined in terms of what occurs behind the interface. Instead, we are limited to defining the syntax of communication, the intent of received communication, and the expected behavior of recipients. If the communication is considered in isolation, then successful actions ought to be reflected in corresponding changes to the observable interface provided by servers. However, since multiple clients might act in parallel and perhaps at cross-purposes, we cannot require that such changes be observable beyond the scope of a single response.
1.2. History and Evolution
HTTP has been the primary information transfer protocol for the World Wide Web since its introduction in 1990. It began as a trivial mechanism for low-latency requests, with a single method (GET) to request transfer of a presumed hypertext document identified by a given pathname. As the Web grew, HTTP was extended to enclose requests and responses within messages, transfer arbitrary data formats using MIME-like media types, and route requests through intermediaries. These protocols were eventually defined as HTTP/0.9 and HTTP/1.0 (see [HTTP/1.0]).
HTTP/1.1 was designed to refine the protocol's features while retaining compatibility with the existing text-based messaging syntax, improving its interoperability, scalability, and robustness across the Internet. This included length-based data delimiters for both fixed and dynamic (chunked) content, a consistent framework for content negotiation, opaque validators for conditional requests, cache controls for better cache consistency, range requests for partial updates, and default persistent connections. HTTP/1.1 was introduced in 1995 and published on the Standards Track in 1997 [RFC2068], revised in 1999 [RFC2616], and revised again in 2014 ([RFC7230] through [RFC7235]).
HTTP/2 ([HTTP/2]) introduced a multiplexed session layer on top of the existing TLS and TCP protocols for exchanging concurrent HTTP messages with efficient field compression and server push. HTTP/3 ([HTTP/3]) provides greater independence for concurrent messages by using QUIC as a secure multiplexed transport over UDP instead of TCP.
All three major versions of HTTP rely on the semantics defined by this document. They have not obsoleted each other because each one has specific benefits and limitations depending on the context of use. Implementations are expected to choose the most appropriate transport and messaging syntax for their particular context.
This revision of HTTP separates the definition of semantics (this document) and caching ([CACHING]) from the current HTTP/1.1 messaging syntax ([HTTP/1.1]) to allow each major protocol version to progress independently while referring to the same core semantics.
1.3. Core Semantics
HTTP provides a uniform interface for interacting with a resource (Section 3.1) — regardless of its type, nature, or implementation — by sending messages that manipulate or transfer representations (Section 3.2).
Each message is either a request or a response. A client constructs request messages that communicate its intentions and routes those messages toward an identified origin server. A server listens for requests, parses each message received, interprets the message semantics in relation to the identified target resource, and responds to that request with one or more response messages. The client examines received responses to see if its intentions were carried out, determining what to do next based on the status codes and content received.
HTTP semantics include the intentions defined by each request method (Section 9), extensions to those semantics that might be described in request header fields, status codes that describe the response (Section 15), and other control data and resource metadata that might be given in response fields.
Semantics also include representation metadata that describe how content is intended to be interpreted by a recipient, request header fields that might influence content selection, and the various selection algorithms that are collectively referred to as content negotiation (Section 12).
1.4. Specifications Obsoleted by This Document
| Title | Reference | See |
|---|---|---|
| HTTP Over TLS | [RFC2818] | B.1 |
| HTTP/1.1 Message Syntax and Routing [*] | [RFC7230] | B.2 |
| HTTP/1.1 Semantics and Content | [RFC7231] | B.3 |
| HTTP/1.1 Conditional Requests | [RFC7232] | B.4 |
| HTTP/1.1 Range Requests | [RFC7233] | B.5 |
| HTTP/1.1 Authentication | [RFC7235] | B.6 |
| HTTP Status Code 308 (Permanent Redirect) | [RFC7538] | B.7 |
| HTTP Authentication-Info and Proxy-Authentication-Info Response Header Fields | [RFC7615] | B.8 |
| HTTP Client-Initiated Content-Encoding | [RFC7694] | B.9 |
[*] This document only obsoletes the portions of RFC 7230 that are independent of the HTTP/1.1 messaging syntax and connection management; the remaining bits of RFC 7230 are obsoleted by "HTTP/1.1" [HTTP/1.1].
2. Conformance
2.1. Syntax Notation
This specification uses the Augmented Backus-Naur Form (ABNF) notation of [RFC5234], extended with the notation for case-sensitivity in strings defined in [RFC7405].
It also uses a list extension, defined in Section 5.6.1, that allows for compact definition of comma-separated lists using a "#" operator (similar to how the "*" operator indicates repetition). Appendix A shows the collected grammar with all list operators expanded to standard ABNF notation.
As a convention, ABNF rule names prefixed with "obs-" denote obsolete grammar rules that appear for historical reasons.
The following core rules are included by reference, as defined in Appendix B.1 of [RFC5234]: ALPHA (letters), CR (carriage return), CRLF (CR LF), CTL (controls), DIGIT (decimal 0-9), DQUOTE (double quote), HEXDIG (hexadecimal 0-9/A-F/a-f), HTAB (horizontal tab), LF (line feed), OCTET (any 8-bit sequence of data), SP (space), and VCHAR (any visible US-ASCII character).
Section 5.6 defines some generic syntactic components for field values.
This specification uses the terms "character", "character encoding scheme", "charset", and "protocol element" as they are defined in [RFC6365].