Skip to content
Search

HTTP:Headers

lastmod 2023-08-20created 2023-02-151 edits

HTTP headers let the client and the server pass additional information with a request or a response.

An HTTP header consists of a case-insensitive name followed by a colon ':', then by its value (without line breaks). Leading whitespace before the value is ignored.

Custom proprietary headers can be added using the 'X-' prefix, but this convention was deprecated in June 2012 in RFC 6648 because of the inconveniences it caused when nonstandard fields became standard. Others are listed in the IANA registry, whose original content was defined in RFC 4229. IANA also maintains a registry of proposed new message headers.

Groups

Headers can be grouped according to their contexts:

General header
Headers applying to both requests and responses but with no relation to the data eventually transmitted in the body.
Request header
Headers containing more information about the resource to be fetched or about the client itself.
Response header
Headers with additional information about the response, like its location or about the server itself (name, version, etc.).
Entity header
Headers containing more information about the entity body, like its content length or MIME type.

Headers can also be grouped according to how proxies handle them:

End-to-end headers
These headers must be transmitted to the final recipient of the message: the server for a request, or the client for a response. Intermediate proxies must retransmit end-to-end headers unmodified, and caches must store them.
Hop-by-hop headers
These headers are meaningful only for a single transport-level connection and must not be retransmitted by proxies or cached

HTTP Headers

  • Caching
    • Age - The time, in seconds, that the object has been in a proxy cache.
    • Cache-Control - Directives for caching mechanisms in both requests and responses.
    • Clear-Site-Data - Clears browsing data (e.g. cookies, storage, cache) associated with the requesting website.
    • Expires - The date/time after which the response is considered stale.
    • Pragma - Implementation-specific header that may have various effects anywhere along the request-response chain. Used for backwards compatibility with HTTP/1.0 caches where the Cache-Control header is not yet present.
    • Warning - General warning field containing information about possible problems.
  • Accept-Language
  • Referer

Favorite site

author Zer0 sitemap