Appendix A: HTTP Headers
HTTP headers are used to transfer all sorts of information between client and server. There are four categories of headers:
| Type | Description |
| General | Information not related to the client, server, or HTTP |
| Request | Preferred document formats and server parameters |
| Response | Information about the server sending the response |
| Entity | Information on the data being sent between the client and server |
General headers and entity headers are the same for both the server and client.
All headers in HTTP messages contain the header name followed by a colon (:), then a space, and the value of the header. Header names are case-insensitive (thus, Content-Type is the same as Content-type). The value of a header can extend over multiple lines by preceding each extra line with at least one space or tab.
This chapter covers the most recent draft of the HTTP 1.1 specification that was available at publication time (draft 7), as well as some headers that are not in the spec but are in common use regardless.
General Headers
General headers are used in both client requests and server responses. Some may be more specific to either a client or server message.
Cache-Control: directives
The Cache-control header specifies desired behavior from a caching system, as used in proxy servers. For example:
Cache-control: no-cache
Both clients and servers can use the Cache-control header to specify parameters for the cache or to request certain kinds of documents from the cache. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access