Hypertext Transfer Protocol (HTTP)

The foundation of any data exchange on the Web and a protocol used for transmitting hypermedia documents.

Modern web applications rely on the extensibility of HTTP through custom headers (x-headers) and sophisticated caching mechanisms (Cache-Control). The protocol's statelessness is overcome by the use of JWT (JSON Web Tokens) or session cookies to maintain state across multiple requests. Understanding HTTP status codes is essential for debugging: 200 (OK), 301/302 (Redirections), 400 (Bad Request), 401 (Unauthorized), 403 (Forbidden), 404 (Not Found), and 500 (Internal Server Error). As APIs have become dominant, HTTP serves as the primary transport for REST and GraphQL architectures.

        graph LR
  Center["Hypertext Transfer Protocol (HTTP)"]:::main
  Rel_http["http"]:::related -.-> Center
  click Rel_http "/terms/http"
  Rel_http_protocol["http-protocol"]:::related -.-> Center
  click Rel_http_protocol "/terms/http-protocol"
  classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
  classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
  classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
  classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
  linkStyle default stroke:#4b5563,stroke-width:2px;

      

🧒 Explain Like I'm 5

Think of [HTTP](/en/terms/http) like a waiter in a restaurant. You (the client) tell the waiter what you want (the request), and the waiter goes to the kitchen (the server) to get your food. The waiter then brings the food back to you (the response). If you want something else later, the waiter won't remember you from your last visit unless you're wearing a name tag (a cookie).

🤓 Expert Deep Dive

HTTP has evolved significantly to optimize web performance. HTTP/1.1 introduced persistent connections (keep-alive) but suffered from 'Head-of-Line' (HoL) blocking. HTTP/2 solved this by using a binary framing layer and multiplexing, allowing multiple requests to be sent concurrently over a single TCP connection. The latest iteration, HTTP/3, replaces TCP with QUIC (a UDP-based protocol) to eliminate HoL blocking at the transport layer and improve performance on lossy networks. Key methods include GET (retrieve data), POST (submit data), PUT (replace data), and DELETE. Security is achieved by wrapping HTTP in a TLS layer (HTTPS), which encrypts the request/response cycle and prevents eavesdropping.

📚 Sources