Read an HTTP exchange
Identify the parts of a request and response and their different responsibilities.
What you’ll learn
- Read a request method and target
- Explain status and metadata
- Distinguish HTTP semantics from transport
Start with the application exchange
HTTP describes how clients and servers exchange requests and responses. When a learner opens a course page, the browser may make several HTTP requests for the document, stylesheets, scripts, and other resources. Each request has a target and a method that expresses an intended operation. The terms client and server describe roles in an exchange; the same software can act as a server for one request and a client when it calls another service.
Read the request deliberately
A request carries control information such as a method and target, metadata in fields, and sometimes content. GET commonly requests a representation of a resource. Other methods have their own defined semantics, so do not decide behavior solely from a URL's spelling. Fields can describe accepted formats, conditional requests, or authentication information. Avoid putting private credentials into a URL because URLs can appear in logs, browser history, and other places that are not appropriate secret stores.
Request (simplified):
GET /lessons HTTP/1.1
Host: example.com
Accept: text/html
Response (simplified):
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
<h1>Lessons</h1>Interpret the response
A response includes a status code, metadata, and possibly content. The status code describes the outcome category, but a useful client also needs the API's documented error representation. A successful transport connection does not mean the application operation succeeded, and a non-success status does not automatically mean retrying is appropriate. For example, a malformed request generally needs correction. When reading an unfamiliar exchange, inspect status, content type, and the actual response rather than assuming every response body is HTML or JSON.
Separate semantics and the connection
HTTP semantics are shared across protocol versions, while message framing and transport behavior differ. HTTP/1.1 and HTTP/2 are commonly carried over TCP, while HTTP/3 uses QUIC over UDP. Therefore, a statement that every HTTP request necessarily creates a fresh TCP connection is incorrect. Connections can be reused, and multiplexing behavior depends on the version. At the application level, still describe each operation's contract without relying on an assumption that the same connection always means the same authenticated user.
Use a request trace as evidence
Open browser developer tools on an application you are allowed to inspect and choose one public document request. Identify its URL, method, response status, and content type. Then compare it with a separate request for private progress data. Notice which responses can be cached publicly and which must respect identity and privacy. Redact cookies, tokens, and personal information before sharing a trace. This exercise links protocol vocabulary to the actual behavior of an application.
Try it yourself
Why should a client inspect an HTTP response status instead of treating any received response as success?
Show a possible solution
A network exchange can complete while the application reports a validation failure, missing resource, authorization problem, or server error. The client needs the status and documented response body to choose a sensible next step.
Check your understanding
Try 14 questions across computer networks. Read each explanation and revisit anything that needs another pass.
Practise this subjectGo to the source
Use these primary references to check details and explore the topic further.
Saved in this browser. Signed-in progress syncs to your account.