Glossary Term
HTTP Response
Learn what an HTTP response is and how servers reply to client requests. Understand response structure, status codes, headers, and body content.
TL;DR: The server’s reply to an HTTP request, containing status code, headers, and usually the requested content. Delivers what you asked for.
An HTTP response is the server’s reply to an HTTP request. Continuing the restaurant analogy, if a request is your order, the response is the waiter bringing your food back from the kitchen.
Every HTTP response contains three main parts:
- Status code: A number indicating if the request succeeded (like 200 for success, 404 for not found)
- Headers: Metadata about the response (like content type, server info, caching rules)
- Body: The actual content being sent back (HTML, JSON data, images, etc.)
HTTP responses are crucial because they deliver the content and information you requested. Without responses, requests would disappear into the void with no feedback.
Examples:
- Successful webpage: Status 200, HTML content in the body, headers indicating it’s HTML
- API data: Status 200, JSON data in the body, headers specifying JSON content type
- File not found: Status 404, error page in the body, headers with error details
Related terms: HTTP Request, Status Code, HTTP Header
Frequently Asked Questions
What is an HTTP response?
An HTTP response is the server reply to a request. It includes status code, headers, and usually a body with the requested content or error message.
What are the parts of an HTTP response?
Status line (version, code, reason), headers (metadata), blank line, and body (content). Example: HTTP/1.1 200 OK followed by headers and HTML.
What is the response body?
The body contains the actual content: HTML pages, JSON data, images, files. Some responses like 204 No Content have no body.
How do I read response headers?
In browser DevTools, click a request in Network tab, then Headers section. Programmatically, use response.headers in fetch or similar APIs.