Lukas' Notes

web

Definition

HTTP Request Header

An HTTP request header is an HTTP header sent by the client to describe the request and the resource it asks for. They appear after the request line ([[Knowledge/HTTP Method|METHOD]] path HTTP/version) and before the blank line that ends the header section.

Common examples:

  • Host — the host name being addressed (required in HTTP/1.1).
  • Origin / Referer — the page that initiated the request, used by cross-origin protections.
  • User-Agent — a string identifying the client.
  • Content-Type — the media type of the request body (e.g. application/x-www-form-urlencoded).
  • Content-Length — the byte length of the request body.
  • Connection — connection control, e.g. close.

The request line plus headers fully describe a single stateless exchange; cookies are attached here via the Cookie header.