What are HTTP headers?

HTTP headers represent metadata associated with each HTTP request and response. Based on the type of information they contain, headers can be grouped into one of the following four categories:

  • Request headers: Information about the resource being fetched or about the client requesting the resource.

  • Response headers: Information about the response that doesn't relate to the HTTP message body.

  • Representation headers: Information about how the resource sent in an HTTP message body is represented (how the content is encoded, compressed, formatted, etc.). These headers are included in both the request and response.

  • Payload headers: Information about the safe transport and reconstruction of the original resource representation (transfer encoding, integrity checks, etc.). These headers are included in both the request and response.

Open the browser console, navigate to the “Network” tab, and refresh this page. Inspect a request to see the associated request and response headers as key/value pairs.

Get hands-on with 1200+ tech skills courses.