HTTP headers are metadata lines in the form "name: value" that a browser and a server attach to every HTTP request and response to agree on data format, caching, cookies and the security of the transfer.
Each message is split into headers and a body. In a request — for example with the GET or POST method — the client states its terms: Host names the domain, Accept sets the desired response format, and Cookie carries saved session data. In the response the server adds its own: Content-Type describes the content type, Content-Length its size, and Location sets a new URL on a redirect.
Headers are usually grouped by purpose:
Well-tuned headers speed up loading through the cache and protect the connection, which is why they are the first thing you inspect when debugging any web application.