NETWORKING / A CONCEPT NOTE

HTTP

the protocol the web speaks

~65 sec read

Overview · mechanism
pitfall · examples

01 / THE SHORT VERSION

The idea in a few sentences.

A request-response protocol where your browser sends a method (GET, POST) + path + headers, and the server replies with a status code (200, 404, 500) plus a body. HTTP/2 and 3 add multiplexing and server push on top.

02 / FOLLOW THE MECHANISM

How a request flows

  1. Client

    resolves DNS, then opens a TCP connection to the server's IP on port 80 (or 443 for HTTPS).

  2. Client

    sends a request line like GET /api/users HTTP/1.1 followed by headers and optionally a body.

  3. Server

    processes the request and returns a status line like HTTP/1.1 200 OK with response headers and body.

  4. Client

    reads the response; the connection is either kept alive (HTTP/1.1) or reused (HTTP/2) for the next request.

04 / COMMAND NOTES

Read the command, then the result.

Inspect the flags and arguments before trying an example. Snippets can need local setup, replacement values, or resources in your own environment.

EXAMPLE 01 · REFERENCE

fetch just the response headers

curl -I https://supraj.dev

EXAMPLE 02 · REFERENCE

see the full request/response exchange

curl -v https://api.example.com

Explore command anatomy in the CLI lab