Reference

HTTP & network inspection

Decode requests, responses, browser rules and network diagnostics.

Scope and conventions

Wire examples use HTTP/1.1 notation; HTTP/2 and HTTP/3 encode it differently. Commands use a Unix-like shell and illustrative example.test hosts. Browser security behavior is labeled separately from HTTP and command-line clients.

Methods & status

Safe versus idempotent methods

HTTP & tools

Safe methods such as GET and HEAD are intended for retrieval without requested state changes. Idempotent means repeating the same request has the same intended server effect, not an identical response.

Fragment

HTTP & tools · Safe versus idempotent methods
Follow appearance
GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
GET     retrieve
HEAD    GET metadata without response content
OPTIONS discover communication options
PUT     replace/create at the target (idempotent)
DELETE  remove the target association (idempotent)
POST    resource-specific processing
PATCH   partial modification (not inherently idempotent)

A server must implement these semantics. Do not put state-changing actions behind GET.

Recognize successful statuses

HTTP & tools

200: success with method-dependent content. 201: resource created, often identified by Location. 202: accepted for processing, not proof of completion. 204: success with no response content.

Fragment

HTTP & tools · Recognize successful statuses
Follow appearance
GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
HTTP/1.1 201 Created
Location: /items/42
Content-Length: 0

Read redirect semantics

HTTP & tools

301/308 describe permanent moves; 302/307 describe temporary ones. 307/308 preserve the method. 303 directs a retrieval, usually GET. Historical 301/302 handling can turn POST into GET.

Fragment

HTTP & tools · Read redirect semantics
Follow appearance
GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
HTTP/1.1 303 See Other
Location: /orders/42
Content-Length: 0

Redirects can cross origins; clients differ in credential forwarding.

Distinguish client error statuses

HTTP & tools

400: malformed or otherwise invalid request. 401: valid authentication credentials are missing (with an authentication challenge). 403: server refuses the action. 404: target not found or not disclosed.

Fragment

HTTP & tools · Distinguish client error statuses
Follow appearance
GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
405 Method Not Allowed -> inspect Allow
409 Conflict           -> reconcile current state
412 Precondition Failed -> stale conditional write
415 Unsupported Media Type -> inspect Content-Type
422 Unprocessable Content -> understood, invalid content
429 Too Many Requests  -> inspect Retry-After

Separate server and gateway failures

HTTP & tools

500: unexpected server condition. 502: invalid upstream response at a gateway. 503: temporarily unable to serve. 504: gateway did not receive an upstream response in time.

Fragment

HTTP & tools · Separate server and gateway failures
Follow appearance
GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
500 Internal Server Error
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout

A timeout does not prove the upstream operation had no effect.