HTTP: Hypertext Transfer Protocol | MDN

HTTP is an application-layer protocol for transmitting hypermedia documents, such as HTML. It was designed for communication between web browsers and web servers, but it can also be used for other purposes, such as machine-to-machine communication, programmatic access to APIs, and more.

Overview

Added

March 18, 2026

Subject & domain

coding · apis-integration

Grade range

Grade 9 (Freshman)–Grade 12 (Senior)

Page kind

Article

Introduction

Overview of the Hypertext Transfer Protocol (HTTP)

  • Core Definition: HTTP is an application-layer protocol designed for transmitting hypermedia documents (like HTML) between web browsers and servers.
  • Communication Model: It follows a classical client-server model where a client initiates a request and waits for a server response.
  • Stateless Nature: HTTP is inherently stateless; however, state can be introduced via cookies (using Set-Cookie and Cookie headers).
  • Extensibility: The protocol is highly extensible, supporting various methods, headers, and extensions developed since its inception in the early 1990s.
  • Key Concepts:
    • URIs: Uniform Resource Identifiers are used to locate resources.
    • Messages: Requests and responses follow a defined structure.
    • MIME Types: Used to identify and transmit different content formats.
    • Caching: Mechanisms to improve performance and resource efficiency.
    • Authentication: Methods to verify client identity.
    • Security: Includes features like CORS (Cross-Origin Resource Sharing), CSP (Content Security Policy), and CORP (Cross-Origin Resource Policy).
  • Protocol Evolution: The protocol has evolved through several versions: HTTP/0.9, HTTP/1.0, HTTP/1.1, HTTP/2, and HTTP/3.
  • Advanced Features:
    • Conditional Requests: Used for caching and resuming downloads.
    • Range Requests: Allows fetching specific parts of a resource.
    • Content Negotiation: Enables clients to request specific formats, languages, or encodings.
    • Connection Management: Supports persistent connections and protocol upgrades (e.g., to WebSockets).
  • Reference Documentation: HTTP includes standardized status codes (grouped into five classes), request methods (e.g., GET, POST), and extensive header metadata.
  • Debugging Tools: Recommended tools include Firefox Developer Tools, HTTP Observatory, RedBot, nghttp2, and curl.

Community reviews

No published reviews yet. Be the first to share your experience.