Editorial draftGuides

Hypertext Transfer Protocol (HTTP): architecture, headers, and data exchange

An ivory browser window and charcoal server exchange two clean red directional arrows carrying small paper request and response packets.

Hypertext Transfer Protocol (HTTP): architecture, headers, and data exchange

The Hypertext Transfer Protocol (HTTP) is the foundational application-layer protocol governing data communication and distributed multimedia resource retrieval across the World Wide Web. Conceived by Tim Berners-Lee at CERN in 1989 and standardized through the Internet Engineering Task Force (IETF) and the World Wide Web Consortium (W3C), HTTP enables web browsers (user agents) to request web pages, images, application scripts, and structured API payloads from remote web servers.

HTTP operates at Layer 7 (the Application Layer) of the Open Systems Interconnection (OSI) and TCP/IP networking models. Traditionally running over Transmission Control Protocol (TCP) on port 80 (unencrypted HTTP) or port 443 (encrypted HTTPS via Transport Layer Security), HTTP establishes a structured, request-response communication pattern.

HTTP Protocol OverviewHTTP Protocol Overview

HTTP Session Architecture

An HTTP session is structured around a discrete client-server request-and-response lifecycle:

  • Session Initiation & Handshake: The client (user agent) resolves the target domain name via DNS, establishes a reliable TCP connection to the host server (typically port 80 for HTTP or port 443 for HTTPS), and completes the cryptographic TLS handshake when using HTTPS.
  • Request Dispatch: The client formats and transmits an ASCII or binary request message comprising a request line (HTTP method, target URI, protocol version), structured request headers (specifying content types, authorization tokens, caching directives, and user-agent details), and an optional request body.
  • Server Ingestion & Processing: The web server receives the message, parses the incoming headers, validates authentication credentials, applies routing rules, and dispatches the request to internal application workers or static file handlers.
  • Response Generation & Transmission: The server returns an HTTP response consisting of a status line (HTTP protocol version, numeric status code, text reason phrase), structured response headers (Content-Type, Set-Cookie, Cache-Control, Content-Length), and the response body.
  • Connection Lifecycle Management: Depending on connection headers (Connection: keep-alive in HTTP/1.1 or binary streams in HTTP/2 and HTTP/3), the underlying TCP/QUIC socket is either maintained open for pipelined multiplexed requests or gracefully closed.

Stateless Protocol Architecture

In its foundational design, HTTP is an inherently stateless protocol: the server retains no persistent session context or memory of previous requests from the same client between discrete interactions. While statelessness simplifies server scalability, load balancing, and fault tolerance—allowing any server in a cluster to handle any incoming request—modern interactive applications require continuous session state.

To overcome statelessness, modern web architectures employ several state-management mechanisms:

  • HTTP State Cookies (Set-Cookie / Cookie): Cryptographically signed or encrypted tokens stored in the browser and transmitted on subsequent requests.
  • JSON Web Tokens (JWT) & Bearer Headers: Stateless cryptographic authorization tokens passed via the Authorization: Bearer <token> header.
  • Server-Side Session Stores: Centralized memory stores (e.g., Redis, Memcached) mapping client session identifiers to authenticated user sessions.

Methods of request

HTTP Client-Server Request and Response Breakdown via Telnet Terminal SessionHTTP Client-Server Request and Response Breakdown via Telnet Terminal Session

HTTP defines a standardized set of request methods (commonly called HTTP verbs) that indicate the desired action to be performed on the identified resource:

  • GET: Requests a representation of the specified resource. GET requests are safe and idempotent; they retrieve data without modifying server state.
  • HEAD: Asks for an identical response to a GET request, but without the response body. This enables clients to inspect response headers (e.g., Content-Length, Last-Modified) for caching or link verification without downloading payload bytes.
  • POST: Submits an entity to the specified resource, commonly resulting in a state change or side effect on the server, such as creating a new database record or processing an order.
  • PUT: Replaces all current representations of the target resource with the uploaded request payload. PUT requests are idempotent.
  • PATCH: Applies partial modifications to an existing resource, transmitting only the modified fields rather than replacing the complete entity.
  • DELETE: Deletes the specified resource identified by the URI. DELETE operations are idempotent.
  • OPTIONS: Describes the communication options and permitted HTTP methods available for the target resource. Frequently utilized in Cross-Origin Resource Sharing (CORS) preflight checks.
  • CONNECT: Establishes a bidirectional network tunnel to the destination server, typically used to facilitate HTTPS connections through an unencrypted HTTP proxy.
  • TRACE: Performs a message loop-back test along the path to the target resource, returning the exact request message received by the server for debugging purposes.

Summary table

HTTP MethodRFC StandardRequest BodyResponse BodySafeIdempotentCacheable
GETRFC 7231Optional / RareYesYesYesYes
HEADRFC 7231NoNoYesYesYes
POSTRFC 7231YesYesNoNoYes (conditional)
PUTRFC 7231YesYesNoYesNo
PATCHRFC 5789YesYesNoNoYes (conditional)
DELETERFC 7231OptionalYesNoYesNo
OPTIONSRFC 7231OptionalYesYesYesNo
CONNECTRFC 7231YesYesNoNoNo
TRACERFC 7231NoYesYesYesNo

HTTP Status Code Classes & Diagnostic Matrix

Code RangeCategoryCommon CodesProtocol MeaningClient Action
1xxInformational100, 101Protocol handshake; server ready for body or upgradeProceed with payload or transition socket
2xxSuccess200, 201, 204Request understood, processed, and fulfilled successfullyProcess returned body or record creation
3xxRedirection301, 302, 304Resource cached, modified, or permanently relocatedFollow target URI or serve cached asset
4xxClient Error400, 401, 403, 404, 429Invalid syntax, missing authentication, or rate limitVerify payload, refresh auth, or throttle calls
5xxServer Error500, 502, 503, 504Upstream crash, gateway timeout, or backend outageCheck server logs; retry with backoff

HTTP Protocol Generations

The HTTP specification has progressed through several major generational architectures:

  • HTTP/0.9 (1991): The initial one-line protocol specification. Supported only the GET method, had no HTTP headers, and transferred raw HTML files without metadata.
  • HTTP/1.0 (RFC 1945, 1996): Introduced HTTP headers, status codes, rich media transfer (MIME types), and POST/HEAD methods. Each request required opening and closing a separate TCP connection.
  • HTTP/1.1 (RFC 2061 / RFC 7230-7235, 1999/2014): Introduced persistent TCP connections (Connection: keep-alive), chunked transfer encoding, byte-range requests, host headers for virtual hosting, and explicit cache control directives. Remained the dominant web protocol for over 15 years.
  • HTTP/2 (RFC 7540, 2015): A major architectural overhaul derived from Google's SPDY protocol. Replaced plaintext framing with a binary framing layer, enabling full bidirectional stream multiplexing over a single TCP connection, HPACK header compression, and server push capabilities to eliminate head-of-line blocking at the application layer.
  • HTTP/3 (RFC 9114, 2022): Replaces TCP and TLS with the QUIC transport protocol running over UDP on port 443. Solves TCP-level head-of-line packet blocking, supports zero-round-trip-time (0-RTT) connection resumption, and provides native connection migration across mobile networks.

Similar protocols

Several specialized application protocols operate alongside or inspired modern HTTP:

  • Gopher Protocol (RFC 1436): An early menu-driven document retrieval protocol popular in the early 1990s, ultimately supplanted by the flexibility of HTTP and HTML hyperlinking.
  • SPDY Protocol: Google's experimental transport protocol that demonstrated the performance benefits of multiplexing and header compression, providing the direct blueprint for HTTP/2.
  • Gemini Protocol: A modern lightweight, privacy-conscious internet protocol designed for low-complexity text distribution, intentionally omitting cookies, tracking headers, and complex scripting.
  • Constrained Application Protocol (CoAP - RFC 7252): A lightweight, RESTful request-response protocol designed specifically for constrained IoT devices and low-bandwidth machine-to-machine networks over UDP.

Architectural References

For deeper technical architectures detailing RESTful API design, headless CMS data integration, and secure application data transmission, explore API mechanisms in Article 045, frontend content delivery architectures in Article 013, and cryptographic data protection in Article 055.

On this page