๐ŸŒ HTTP & Web

โ† Back to Cheatsheets

A quick-reference for HTTP โ€” the protocol behind every web request. Covers methods, status codes, common headers, and URL structure. Understanding these is useful whether you're building APIs, debugging network issues, or reading server logs.

Resources

MDN โ€” HTTP docs httpstatuses.io MDN โ€” Headers reference http.cat โ€” visual status codes

URL Anatomy

Every URL maps to a specific resource. The path and query string are sent to the server; the fragment (#) is browser-only and never sent.

Methods

Methods describe the intended action. Safe methods don't modify state. Idempotent methods produce the same result no matter how many times they're called.

Common Headers

Headers pass metadata alongside a request or response. Request headers describe the client; response headers describe the server's reply and how to handle it.

1xx โ€” Informational

Provisional responses. The request was received; processing continues.

2xx โ€” Success

The request was received, understood, and accepted.

3xx โ€” Redirection

The client must take further action to complete the request. The target URL is given in the Location header.

4xx โ€” Client Errors

The request contains bad syntax or cannot be fulfilled. The problem is on the client side.

5xx โ€” Server Errors

The server failed to fulfil a valid request. The problem is on the server side.