Every time a web page appears on your screen, two machines have just finished a fast, rigidly polite conversation. One asked for something; the other answered. The rules of that exchange — who speaks first, what a request looks like, how the reply is labelled — are what we call HTTP. And when that same conversation has to happen where no one else can listen in, it gains a single quiet letter: the S in HTTPS.

A Protocol Is Just an Agreement

Before anything technical, it helps to strip the word "protocol" of its intimidation. A protocol is simply a shared agreement about how to communicate — the digital equivalent of two people agreeing to speak the same language, take turns, and finish each sentence clearly. HTTP, the Hypertext Transfer Protocol, is the agreement that browsers and web servers use to move pages, images, videos and data across the web.

HTTP follows a client–server model. The client — your browser — opens a connection, sends a request, and waits. The server processes it and returns a response. The client always speaks first; the server never volunteers anything unasked. Underneath, these messages travel over a reliable transport connection called TCP, so that every byte arrives complete and in the right order. By convention, HTTP servers listen on port 80 and HTTPS servers on port 443 — like a building address and a specific apartment number, so traffic always finds the right door.

One property surprises newcomers: HTTP is stateless. The server keeps no memory of you between two requests — each one arrives as if it were the first the server had ever seen. That sounds limiting, but statelessness is exactly what lets the web scale to billions of requests. Memory is added on top through cookies: small pieces of data the browser attaches to each request so the server can recognise a returning visitor.

The Analogy — What a protocol is

Think of two strangers who want to do business but share no common tongue. Before a single deal happens, they agree on ground rules: we'll speak English, I'll ask and you'll answer, and we'll both signal clearly when a sentence ends. Only then can they trade reliably. HTTP is that agreement for machines — and because both sides follow it to the letter, any browser can talk to any server, anywhere in the world.

The Anatomy of a Request and a Reply

An HTTP message is plain, structured text divided into three zones — you will see them colour-coded in the diagram below. The first is the start line 1: a single line naming the method (what you want to do), the path (which resource), and the HTTP version being spoken. Next come the headers 2: labelled lines of metadata such as which host you are addressing or what content format you accept. Finally, separated by a blank line, sits the optional body 3 — data you are sending, like a form submission. A simple GET request has no body at all.

The response mirrors that exact shape. Its start line — called the status line 1 — carries the HTTP version, a three-digit status code, and a short phrase. Its headers 2 describe the content coming back. And its body 3 is the actual payload: the HTML, the image, the JSON — whatever you came for. Reading the diagram left to right, you are seeing one full round trip.

The structure of an HTTP message REQUEST 1 GET /index.html HTTP/1.1 start line — method · path · version 2 Host: example.com User-Agent: Mozilla/5.0 Accept: text/html headers — metadata about the request 3 (no body for GET) body — data sent (empty for GET) RESPONSE 1 HTTP/1.1 200 OK status line — version · code · reason 2 Content-Type: text/html Content-Length: 1024 Cache-Control: max-age=60 headers — metadata about the response 3 <html> … </html> body — the actual content returned
The three zones appear in both messages: 1 the start/status line, 2 headers with metadata, 3 the body with content.

The Verbs: What You Can Ask For

Methods are the verbs of the web. They tell the server not just which resource you mean, but what you want to do with it. Two ideas help understand how each verb behaves. A method is safe if it only reads and changes nothing on the server. It is idempotent if repeating the exact same request always leaves the server in the same state — useful when a flaky network forces you to retry.

GET

Safe · Idempotent

Retrieve a resource. Should only fetch, never alter — by far the most common request on the web.

Like browsing a menu at a restaurant — you look, nothing changes.

POST

Not idempotent

Submit data to create something new, trigger an action, or process information. Sending it twice may create two records or charge twice.

Like placing an order — do it twice and you get charged twice.

PUT

Idempotent

Replace a resource entirely with the data you send. Repeating it always produces the same intended state on the server — even if the response code differs.

Like replacing your profile photo — the old one is gone, the new one takes its place.

PATCH

Depends on operation

Apply a partial change, updating only the fields you specify. May or may not be idempotent depending on how the operation is designed.

Like correcting only your surname — everything else on the form stays untouched.

DELETE

Idempotent

Remove a resource. The intended outcome is always the same — the resource does not exist. A second call may return 404, but the state is unchanged.

Like cancelling a reservation — once cancelled, cancelling it again makes no difference.

HEAD · OPTIONS

Safe · Idempotent

Fetch only a response's headers without its body (HEAD), or discover which methods a resource supports (OPTIONS).

Like asking "is the restaurant open?" before making the trip — you check without committing.

One distinction worth keeping in mind: idempotent and "changes state" are not opposites. PUT and DELETE both modify the server's state, yet they are idempotent — repeating them always leaves the resource in the same intended condition. The table below shows how the properties combine:

Method Safe Idempotent Typical use
GET Retrieve a resource
HEAD · OPTIONS Inspect headers / discover capabilities
PUT Replace a resource entirely
DELETE Remove a resource
POST Create or process — result varies each call
PATCH ✗ / ✓ Partial update — depends on the operation

The Replies: Reading a Status Code

Every response carries a three-digit code. Its first digit alone tells you the outcome. Learning to read that leading digit is one of the fastest ways to understand what the web is doing behind the scenes.

Range Category What it means Common examples
1xx Informational A provisional signal — the request was received and the process continues. 100 Continue
2xx Success The request was received, understood and fulfilled. 200 OK · 201 Created
3xx Redirection The resource lives elsewhere; the browser follows automatically. 301 Moved · 302 Found
4xx Client error Something about the request was wrong — the fault is on the asking side. 404 Not Found · 403 Forbidden
5xx Server error The request was valid, but the server failed to fulfil it. 500 Internal · 503 Unavailable

Adding the S: When the Conversation Is Sealed

Plain HTTP has one glaring weakness: it travels in the open. Anyone positioned between you and the server — on shared Wi-Fi, at an internet provider, somewhere along the route — can read every byte. This is not theoretical; it is trivially easy to demonstrate with a packet sniffer on any public network.

HTTPS closes that gap. It is not a different protocol but the same HTTP wrapped inside a layer of encryption called TLS (Transport Layer Security). The S simply stands for secure. HTTPS solves three problems at once: encryption scrambles the data so eavesdroppers see only noise; authentication proves the server really is who it claims to be, using a digital certificate issued by a trusted authority; and integrity ensures the content was not quietly altered in transit.

All three are established in an opening exchange called the TLS handshake — a brief negotiation that happens before any page content flows. Think of it as two parties agreeing on a private code before the real conversation begins.

HTTP — Port 80 GET /login · user=alice · pass=hunter2 Browser Server sniffer reads everything ✗ Exposed HTTPS — Port 443 ▓▒░▓▒░▓▒░ encrypted ciphertext ▓▒░▓▒░ Browser Server sniffer sees only gibberish ✓ Encrypted
HTTP sends everything in plain text — credentials included. HTTPS wraps the same conversation in encryption, so intercepted traffic is unreadable.
The TLS handshake — where HTTPS gets its S CLIENT SERVER "Hello" — supported ciphers & TLS version "Hello" + certificate (server's public key) 🔑 Client verifies the certificate, agrees a shared secret Both derive matching session keys Encrypted session — ordinary HTTP now flows inside
Slow public-key cryptography is used just once, only to agree on the fast shared keys that encrypt everything after.
The Analogy — Certificates and the sealed room

Picture a passport stamped by a trusted authority: it lets you confirm a stranger really is who they say. The certificate does that job for a server — your browser checks it before trusting anything. The handshake is the moment you both agree on a private code known only to the two of you. From then on you keep speaking the same language as before — plain HTTP — but every sentence is written in that code, meaningless to anyone who intercepts it.

This design is clever about speed. Public-key cryptography is secure but slow, so TLS uses it only briefly — to establish a shared secret — and then switches to much faster symmetric encryption for the rest of the session. The current version, TLS 1.3, trimmed the handshake to a single round trip, making the overhead nearly invisible. Security, once a noticeable tax on speed, is now essentially free — which is a large part of why the web has moved almost entirely to HTTPS.

Three Generations of the Same Conversation

HTTP's meaning — its methods, headers and status codes — has stayed remarkably stable since the 1990s. What kept changing is how efficiently those messages travel. Each generation solved a bottleneck the previous one exposed.

One conversation, three generations of plumbing HTTP/1.1 1997 · over TCP One request at a time. A slow reply blocks the whole queue. HTTP/2 2015 · over TCP Many streams share one connection, in a compact binary form. HTTP/3 2022 · over QUIC / UDP Streams are truly independent — one lost packet stalls no other.
The semantics never changed; only the plumbing did, from a single text lane to independent encrypted streams.
Version Year Transport Key idea
HTTP/1.1 1997 TCP Persistent connections — reuse one connection for many requests, but still largely one at a time.
HTTP/2 2015 TCP Binary framing, multiplexed streams and header compression over a single connection.
HTTP/3 2022 QUIC / UDP Independent streams and built-in TLS 1.3; a lost packet no longer stalls the rest.

HTTP/1.1 introduced persistent connections, so a browser no longer opened a fresh connection for every image and stylesheet. But it still handled requests largely one after another: a single slow response could hold up everything queued behind it — a problem known as head-of-line blocking. Browsers worked around it by opening several connections at once, which helped but was never elegant.

HTTP/2 rethought the transport entirely. It replaced human-readable text with a compact binary format and introduced multiplexing: many independent streams interleaved over a single connection, plus header compression to cut repetitive overhead. Think of the difference between a single-lane road where every car waits for the one ahead, and a multi-lane highway where traffic flows in parallel — HTTP/2 added the lanes. A large step forward — yet because it still ran over TCP, one lost packet could stall every stream at once, pushing the blocking problem down a layer rather than removing it.

HTTP/3 takes the boldest step: it drops TCP in favour of QUIC, a newer transport built on UDP. QUIC treats each stream as genuinely independent, so a lost packet on one stream no longer freezes the others. It folds TLS 1.3 encryption directly into the connection setup and can even survive a change of network — switching from Wi-Fi to mobile data — without starting the conversation over.

That is the quiet elegance of the whole system. The words a browser and server exchange today would be recognisable to the web of thirty years ago — a method, a path, a status code. Everything underneath has been rebuilt for speed and privacy, while the conversation itself stayed simple enough to explain in a single sitting.

What to Look for Next Time

The next time you open a website, the concepts in this article are right there on screen — you just need to know where to look.

Click the padlock icon in your browser's address bar on any HTTPS site. You will see the certificate that authenticated the server and the TLS version that sealed the session. On most browsers you can also open the Developer Tools (F12 on Windows, Cmd+Option+I on Mac) and go to the Network tab. Reload the page and watch every HTTP request appear in real time: the method, the path, the status code, and the response headers — the exact anatomy this article described.

Try visiting http://example.com instead of https://example.com and see whether your browser redirects you automatically (a 301 status code) or warns you about an insecure connection. That redirect is HTTP/HTTPS in action, visible in the Network tab as a pair of requests: one that returns 301 and one that finally returns 200.

Main References

  1. MDN Web DocsHTTP — reference and guides (overview, messages, methods, status codes) — developer.mozilla.org/en-US/docs/Web/HTTP
  2. IETFRFC 9110: HTTP Semantics, June 2022 — rfc-editor.org/rfc/rfc9110.html
  3. IETFRFC 8446: The Transport Layer Security (TLS) Protocol Version 1.3, August 2018 — rfc-editor.org/rfc/rfc8446.html
  4. IETFRFC 9114: HTTP/3, June 2022 — rfc-editor.org/rfc/rfc9114.html
  5. Cloudflare Learning CenterWhat happens in a TLS handshake?cloudflare.com/learning/ssl
← Previous article
← Back to all articles