concept HTTP, TLS & web servers
HTTP request and response
Read the method, target, headers, optional body, status and returned content in a small HTTP exchange.
What it means
An HTTP request asks a server to perform an action on a target resource; an HTTP response describes the result. The request has a method (such as GET or POST), a target and headers. It may have a body. The response has a status code and headers, and may have a body. Headers carry metadata; they are not all instructions to the server. HTTP semantics
A URL identifies where the request is directed, but its fragment (the part after #) is not sent as the HTTP request target. The browser or client first establishes the relevant connection; with HTTPS, TLS protects the HTTP exchange in transit. HTTP alone does not promise encryption.
Try it
Example — assemble an HTTP exchange locally. Choose GET or HEAD, a synthetic path and a supported media type, then run the local exchange. Inspect a message part to connect the request start line, fields and body with the corresponding response elements. Nothing is sent to a server.
Build a local HTTP exchange
Change the method or target and inspect what belongs to the request and the response.
The target selects a route; the method describes the requested action. This fixture chooses a representation from Accept, but a real server controls its own negotiation.
- Preview inputs
- Route exists
- Response 200
| Item | State / result | Why it matters |
|---|---|---|
| Selected part | start | The request start line names the method, origin-form target and HTTP/1.1 version. |
| Request start line | GET /guide HTTP/1.1 | Method and origin-form target; fragments are not included. |
| Request fields | Host: www.example.test; Accept: text/html | Host identifies the authority in this HTTP/1.1 example. |
| Request body | None | These GET/HEAD examples do not upload data. |
| Response status | 200 | The response status is not a request method. |
| Response fields | Content-Type: text/html; Content-Length: 22 | Metadata about the selected representation. |
| Response body | <h1>Example guide</h1> | HEAD has no response content even when the route exists. |
An invented HTTP/1.1 text exchange. No fetch, server or actual browser request.
About this model
Only GET/HEAD and two media types are modeled. / and /guide exist; other allowed paths do not. The ASCII representation length is fixed for this fixture. HTTP/2 and HTTP/3 use different framing. GET and HEAD have no request content here.
Read the article’s primary sources for protocol rules and implementation-specific limits. This scene has no network access.
The fixture contains / and /guide; /missing is a valid question for an absent route. Compare GET /guide with HEAD /guide. Both describe the same selected representation, but HEAD has no response content. Its Content-Length can describe the corresponding GET representation; it does not mean that many body bytes were transmitted in the HEAD response. Method semantics
| Local request | Status | Response content |
|---|---|---|
GET /guide, HTML | 200 | The fixed guide representation |
HEAD /guide, HTML | 200 | None; representation metadata remains |
GET /missing, HTML | 404 | The fixture's error representation |
GET /guide, JSON | 200 | A different declared representation selected by this fixture |
The Accept control demonstrates a server's declared negotiation policy, not a rule that every server must produce JSON. Unknown methods, control characters, arbitrary URLs and unsupported target syntax are rejected. The path field accepts only the displayed bounded characters and never accepts credentials or request headers. Reset restores GET /guide, HTML and the start-line explanation.
The displayed exchange is an HTTP/1.1 teaching representation with ASCII bodies. HTTP/2 and HTTP/3 frame messages differently. GET/HEAD request content, informational responses, streaming, compression and connection reuse are outside this small scene. HTTP/1.1 request target and framing
What happens to a request?
- A client derives the origin and request target from the URL. DNS name lookup, connection setup and TLS negotiation (for HTTPS) are separate concerns.
- It sends the method and fields. An API might send a JSON body with a
POST; a normalGEToften has no content. Do not infer that every request has a body. - A server, application or intermediary determines a result: for example
200 OK, a redirect,404 Not Found, or a server failure. - The client interprets status, response headers and any received content. A
204 No Contentresponse deliberately has no body; aHEADresponse also has no message body, even when headers describe the representation. Message framing
| Part | A useful question |
|---|---|
| Method | What action is being requested? |
| Target | Which resource on this origin? |
| Request headers | What preferences or conditions are supplied? |
| Response status | What kind of result occurred? |
| Response headers | What representation or caching policy applies? |
| Optional body | What data, if any, accompanies the message? |
When it helps
In browser developer tools, select a request and inspect its URL, method, status, request and response headers separately. A successful TLS connection does not imply an HTTP 200; a completed HTTP exchange may legitimately return 404. A response body may be JSON, HTML, an image or nothing. Caches and proxies may participate, so the response did not necessarily originate from the application itself.
Avoid pasting authentication cookies, bearer tokens or customer data into troubleshooting tickets. Share only sanitized headers and the status needed to reproduce a problem.
In practice
Start with HTTPS and TLS to understand connection protection. For a real 404, follow HTTP 404 troubleshooting; for a proxy-side 502, use HTTP 502 troubleshooting. HTTP status, DNS answers and TLS validation are three different observations.
Key takeaways
Separate the requested action from the server's outcome. Read fields in the context of their request or response, and do not infer transmitted body bytes from a status or header alone. When diagnosing a real exchange, preserve method, target, status and representation context without exposing private headers or content.
Sources & model boundaries
Primary references used for this explanation. The interactive example is an educational model, not a live check.
- RFC 9110 — HTTP Semantics
Sections 6, 8, 9 and 15. HTTP messages, methods, representations and status codes.
Checked .
- RFC 9112 — HTTP/1.1
Sections 2–7. Textual HTTP/1.1 message format, framing and message bodies.
Checked .