Quiz Entry - updated: 2026.07.14
What is the structure of an HTTP request and an HTTP response?
Both are plain text: a first line, header fields (one per line), a blank line, then an optional message body.
| Part | Request | Response |
|---|---|---|
| First line | Request line — METHOD resource HTTP/version (e.g. GET /index.html HTTP/1.1) |
Status line — HTTP/version code reason (e.g. HTTP/1.1 200 OK) |
| Headers | Request headers (Host:, User-Agent:, Cookie:, Accept:, …) |
Response headers (Content-Type:, Set-Cookie:, Cache-Control:, …) |
| Blank line | Separates headers from body | Same |
| Body (optional) | Form data for POST/PUT | HTML/JSON/image bytes |
Why it matters for security: because HTTP is text, every part is parseable and forgeable by anything sitting in the middle. Headers in particular are wide open — User-Agent, Referer, X-Forwarded-For are all client-supplied and must not be trusted as authentication.
Tip: Browser dev tools (F12 → Network) show you the exact text of every request and response. Look at one — the protocol is much smaller than people assume.