HTTP Request & Response Lifecycle
Hypertext Transfer Protocol (HTTP) powers web APIs, document delivery, and WebSocket connection upgrades.
1. Request Methods & Semantics
| Method | Safe | Idempotent | Role |
|---|---|---|---|
GET | Yes | Yes | Retrieve a resource without side effects. |
POST | No | No | Submit payloads or create resources. |
PUT | No | Yes | Replace a target resource completely. |
DELETE | No | Yes | Remove the specified resource. |
2. Conditional Caching Headers
GET /api/v1/config.json HTTP/1.1
Host: api.example.com
If-None-Match: "v4-9f82c1a"
Cache-Control: no-cache
3. Status Code Reference
101 Switching Protocols— Accepted anUpgradeheader.200 OK/204 No Content— Request succeeded.304 Not Modified— Cached copy is still fresh.429 Too Many Requests— Rate limit reached; checkRetry-After.
4. Protocol Versions
- HTTP/1.1: Text headers, one active request per connection.
- HTTP/2: Binary framing with multiplexed streams over TCP.
- HTTP/3: Runs over QUIC (UDP) with built-in TLS 1.3.