How it works · 16 of 36 Foundation
What are a request and a response in HTTP?
Every tap asks, every screen answers
Request and response (HTTP): A request is the message a client sends (a method like GET plus a path); a response is what the server sends back: a status code such as 200 (OK) or 404 (not found) and the content.
Loading the animation…
Say it like this Every tap sends a request, a method like GET plus a path, and every screen is a response that starts with a status code: 2xx worked, 4xx the request was wrong, 5xx the server failed.
Under the hood — for builders
- Real case: the standard's own example exchange
- This request and response are copied from the HTTP rulebook. The first line of each carries the meaning; the rest are labelled details (headers):
- The five kinds of status code
- A client must understand at least the first digit of any status code. The standard defines five classes:
- Worked example: 503 and "come back later"
- An overloaded server can answer 503 with a Retry-After line saying how long to wait. The standard's own example asks for 120 seconds:
- GET and POST
- GET asks for something and changes nothing. POST sends something for the server to act on, like placing an order (RFC 9110, section 9.3).
- Measure it
- Browser: F12 → Network tab → reload. The Status column shows each request's code: mostly 200, some 304, any 404s in red.
- Watch out
- POST isn't idempotent (RFC 9110, section 9.2.2): blindly retrying one can place the same order twice.
- Sources
- RFC 9110, HTTP Semantics (sections 3.9, 9.3, 10.2.3, 15, 15.6.4). Read 28 Nov 2026.
What happens in the HTTP requests and responses animation, step by step?
- Every tap in an app starts a loop: the app sends a request, and the server sends back a response.
- A request says what you want: a method, like GET (fetch this) or POST (take this), and a path, like /orders/42/status.
- The response starts with a status code. 200 means OK, here it is, and the order map fills your screen.
- Your turn: tap something in the app and read the number that comes back.
- The first digit says whose problem it is: 2xx worked, 3xx look elsewhere, 4xx the request was wrong, 5xx the server failed.
- Every tap is a request; every screen is a response. Next: what does the padlock in HTTPS add?
What everyday example explains HTTP requests and responses?
Handing a chit to a counter and getting either your order or a note saying why not.
Why should a team care about HTTP requests and responses?
Status codes tell you at a glance whose problem an error is: 4xx is the request's, 5xx is the server's.