An HTTP response header is a named field in an HTTP response that carries information about the response before any content. It can describe the returned representation, set caching instructions, identify a resource, or provide other context. The status code is separate: it reports the outcome of the request.
Where response headers fit in an HTTP response
HTTP specifications use the term header field; “header” is the common shorthand. A field is an extensible name-and-value pair in the response header section. Fields can modify or extend message semantics, describe the sender or content, or provide context. They are metadata, not the response body.
| # | Preview | Product | Price | |
|---|---|---|---|---|
| 1 |
|
High Performance Browser Networking: What every web developer should know about networking and web... | $30.87 | Buy on Amazon |
| 2 |
|
Learning HTTP/2: A Practical Guide for Beginners | $18.11 | Buy on Amazon |
| 3 |
|
HTTP: The Definitive Guide | $26.04 | Buy on Amazon |
| 4 |
|
HTTP Pocket Reference: Hypertext Transfer Protocol | $6.94 | Buy on Amazon |
| 5 |
|
HTTP/2 in Action | $42.73 | Buy on Amazon |
As an Amazon Associate I earn from qualifying purchases.
In HTTP/1.1, a response is commonly represented with a status line, followed by header fields, a blank line, and then content when present. For example:
HTTP/1.1 201 Created
Content-Type: application/json
Location: https://example.com/users/123
Cache-Control: no-store
{"message":"New user created"}
Here, 201 Created is the status code and reason phrase in the status line, not a header field. Content-Type describes the representation, Location identifies a resource associated with the response, and Cache-Control supplies caching directives. The JSON object after the blank line is content. These example values illustrate common roles; actual field values and rules depend on the response and the relevant field definition. See the IETF’s RFC 9110, HTTP Semantics.
#1 Best Overall
- Used Book in Good Condition
What a response header does
A response field gives the client details that complement the request’s outcome. The status code answers, in broad terms, what happened; fields provide additional information about the response, its representation, or how it may be handled. A field’s scope depends on its definition, so not every field is simply a description of the body.
Content-Typeidentifies the media type of the returned representation.Cache-Controlprovides caching directives.Locationcan identify a related resource or a newly created resource.DateandServerare examples of other commonly encountered response fields, each with its own defined semantics.
For example, a response with 201 Created can use Location to point to the resource that was created, while Content-Type describes the representation returned in the response. The status code and fields work together, but they are different parts of the message.
Rank #2
Response headers, status codes, and content compared
| Part of the response | Where it appears | Main purpose | Example |
|---|---|---|---|
| Status code | In response control data; in HTTP/1.1, shown on the status line before fields | Indicates the outcome of the request | 201 Created |
| Header field | In the header section, before content when present | Adds information or instructions defined by that field | Content-Type: application/json |
| Content | After the header section, when present | Carries the returned representation data | {"message":"New user created"} |
How header fields are written and displayed
Field names are case-insensitive: Content-Type and content-type refer to the same field name. In HTTP/1.x, fields are conventionally displayed as a name, a colon, and a value. HTTP/2 and later use different wire formats; developer tools commonly display lowercase field names, and protocol pseudo-headers are colon-prefixed. A tool’s display is not proof that all HTTP versions use identical syntax. For details, see MDN’s HTTP headers reference.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
If you are defining a custom field, do not assume it must begin with X-. That prefix convention was deprecated in 2012; interoperable fields should use a properly defined and registered name. MDN explains the convention and its history in its HTTP headers reference.
Rank #3
Can a response have headers but no content?
Yes. A response to a HEAD request has no content, but it generally carries the fields that a corresponding GET response would have, subject to the exceptions in the standard. Those fields can still provide useful representation metadata even though there is nothing after the header section to read as content. RFC 9110 defines this behavior in its section on the HEAD method.
Key distinction
An HTTP response header is one field in the response’s header section—not the status code and not the content itself. Its name determines what its value means, and the applicable field definition determines how that value should be interpreted.
Quick Recap
Best Value
Rank #4
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Recommended Free Tools




