How does an HTTP request-response cycle work? Follow a request from client to browser
Follow an HTTP request from its method and headers through the server's response, then learn how browsers request page resources and how to inspect failures.
An HTTP request-response cycle is an exchange in which a client sends a request and a server returns a status code, headers, and, when needed, a body. A browser may not be done after receiving one page. While processing HTML, it can send separate requests for resources such as images, stylesheets, and scripts.
What one request and response contain
An HTTP request usually includes a method describing the desired operation, a target path, and optional headers. Depending on the method and context, it can also include a body. GET /products/42 is an example of asking for a resource; POST /orders is an example of sending data for the server to process. These two methods do not cover every operation: the methods supported and their meaning depend on the resource and API.
A server response contains a status code, optional descriptive text, headers, and sometimes a body. 200 OK indicates success, but what the returned content means depends on the method. 404 Not Found means the server could not find the requested resource; a 500-class status indicates a server-side problem while handling the request. A response does not always have a body: for example, 204 No Content has none.
From the browser to the displayed page
Here is a common example of a browser requesting a product page:
The browser prepares a URL and request information, then creates a network connection or reuses one. The connection details depend on the HTTP version and transport configuration.
The browser sends an HTTP request with a method, path, and headers. A request such as `POST` may also contain a body with data for the server.
The server or an intermediary proxy receives and processes the request according to configured rules, such as resource lookup, authorization, or caching. An application may read data or build a response.
The server sends an HTTP response containing a status code and headers, plus a body when appropriate.
The browser interprets the response. If it receives HTML, it may discover referenced images, CSS, or JavaScript and send additional requests for them while displaying the document.
These steps are a conceptual overview. HTTP/1.1, HTTP/2, and HTTP/3 differ in how they transmit messages, while core HTTP semantics such as methods, status codes, and headers remain. HTTP/2 can carry requests on multiple streams, so do not assume every request finishes one at a time in strict sequence.
HTTP is stateless by default, but a service can use sessions
HTTP treats each request as independent by default. A server should not be assumed to remember earlier requests automatically. A service that needs to keep user context across requests, such as sign-in, can pass session information through a mechanism such as cookies. Cookies may be included in requests, and a server can use them to check sign-in state or permissions. Therefore, “HTTP is stateless” does not mean a web service cannot maintain session state.
Where to look when a request fails
In the browser's Network panel, select the failing request and inspect its URL, method, status code, request and response headers, body, and duration. Compare the response body with server or proxy logs to narrow down which layer ended the request. For example, 404 may mean a mistyped URL, but it can also be used to hide a resource the requester is not allowed to access. Do not infer the cause from the code alone. For a 500-class status, check server logs and the request ID as well.
For a public URL, you can inspect the response headers and body with curl:
curl -i https://example.com/products/42example.com is a documentation example domain. Replace it with a URL you are authorized to inspect. The -i option prints response headers so you can review the status and metadata such as Content-Type alongside the body. Avoid exposing credentials in command history or shared logs when a request needs authentication or private data.
In short
A request conveys the client's intended operation and optional data; the response returns the processing result and, when applicable, a representation. If a page looks wrong, inspect the relevant request and response in the Network panel, then compare them with server logs. A page can involve several requests, and connection reuse or concurrent transmission depends on the HTTP version.
Example: a product page and its CSS file
This is a hypothetical HTTP/1.1 exchange for explanation. Actual headers and representations vary by browser, server, cache, and configuration.
GET /products/42 HTTP/1.1
Host: shop.example.com
Accept: text/htmlIf the server finds the page, it might return HTML like this:
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
<html><head><link rel="stylesheet" href="/assets/site.css"></head>
<body><h1>Trail shoes</h1></body></html>200 means this request received a successful response; Content-Type says the body is HTML. After parsing the body, the browser finds the /assets/site.css reference and sends a separate GET request for that file. Multiple rows in the Network panel can therefore represent separate resource requests made while rendering the page, not one request split into several responses. The host and product name are illustrative and do not describe a specific real service.
Sources
[MDN: HTTP messages](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Messages)
[MDN: Overview of HTTP](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Overview)
[MDN: A typical HTTP session](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Session)
[MDN: HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status)