What is the difference between an HTTP request header and a response header?
Quick answer
A request header travels from the client to the server as part of an HTTP request. A response header travels from the server to the client as part of the HTTP response. Both carry metadata: request headers can describe the requested resource or client, while response headers can add information about the response, including its format. Direction depends on which message contains the header; some fields can be used in more than one context. [S1] [S2]
The question, the details, the next step.
A practical checklist
Locate the message boundary before classifying a header.
For a request, label direction client to server; for a response, label server to client.
Record the header name and value under the message where it appears.
Treat examples as illustrative; do not assume every field is exclusive to one direction.
If a tool hides the request/response split, check its documentation or use a clearer view.
A few more useful answers
Do request and response headers both carry metadata?
Yes. Both pass additional information with an HTTP message; the information’s role depends on whether it accompanies the request or the response. [S2]
Can the same header field appear in both directions?
Some fields can be used in more than one context. Check the message containing the field instead of inferring direction from its name. [S2]
Does a response header describe the response body?
It can provide information about the response, including the format actually returned. The example’s Content-Type illustrates that use. [S1]
Sources
References used for this guide.
- [S1] HTTP messages — MDN developer.mozilla.org · Checked
- [S2] HTTP headers — MDN developer.mozilla.org · Checked
