Almost everything a browser does on the internet is HTTP: opening a page, submitting a form, fetching data for an interface. Services talk to each other the same way: a REST API is built on HTTP, and a mobile app calls its backend over it. The protocol appeared in 1990 together with the web itself and has remained its main way of transferring data ever since.
How a request and response work
HTTP follows a “request and response” pattern: the client sends a request, the server returns a response, and the exchange is over. The protocol is stateless: each request is understandable on its own, and the server does not remember earlier ones. The roles are tied not to programs but to a connection: the same service can be a client in one connection and a server in another.
GET /articles/42 HTTP/1.1Host: glob.uzAccept: application/json HTTP/1.1 200 OKContent-Type: application/jsonCache-Control: max-age=60 {"id": 42, "title": "…"}| Method | What it does | Idempotent |
|---|---|---|
| GET | reads a resource, with no side effects | yes |
| HEAD | like GET, but without a body — headers for checking | yes |
| POST | creates a resource or starts processing | no |
| PUT | replaces a resource entirely | yes |
| PATCH | changes a resource partially | no |
| DELETE | deletes a resource | yes |
The method says what to do with the resource. The status code says what happened: 200 is success, 301 and 308 mean moved permanently, 404 means the resource does not exist, 500 is a server error. The 3xx, 4xx and 5xx codes, together with headers such as Location and Retry-After, tell the client what to do next.
Versions: HTTP/1.1, HTTP/2, HTTP/3
| Version | Year | Transport | Main change |
|---|---|---|---|
| HTTP/1.1 | 1997 | TCP | persistent connections, chunked transfer; still the baseline |
| HTTP/2 | 2015 | TCP | binary format, multiplexing of requests in one connection |
| HTTP/3 | 2022 | QUIC over UDP | fast handshake, no head-of-line blocking at the transport level |
In HTTP/1.1, several parallel requests required several connections. HTTP/2 packed requests into frames inside a single TCP connection and compressed headers, but the loss of one TCP packet stalled all requests at once. HTTP/3 moved connection management into QUIC: streams are independent, and a lost packet delays only the requests it affects. All versions share the same semantics, defined in RFC 9110, so client and server pick a version according to their own and the network’s capabilities.
State and caching
State is kept not in the protocol but in headers: cookies carry a session identifier, and Authorization carries an access token. Caching is also an agreement expressed in headers: Cache-Control and ETag let a browser or proxy avoid downloading an unchanged resource again and instead send a conditional request and get a short 304 response.
Sources
the term is written from these pagesVerified 9 Nov