# HTTP Header

> A label on a web request or reply. Each has a name and a value.

**Field:** Infrastructure  
**Category:** Networking  
**Also known as:** Header, Request Header, Response Header, HTTP Headers

## Think of it like

Think of it like the notes on the outside of a parcel. Fragile, this way up, from Emma.

## Definition

An HTTP header is a name and a value sent with a request or a response. One example is Content-Type: application/json. Headers carry details about the message, not the message itself. They say what kind of data is inside, who is asking, what language is wanted and how long to keep a copy. A request or response can carry dozens of them. Each one sits on its own line, before the body.

## Example

Emma's app sends Authorization: Bearer with her token in a header. The server reads it and knows who she is.

## Example code

```http
Content-Type: application/json
Accept-Language: en
Cache-Control: max-age=3600
```

Three headers: the data type, the language wanted and how long to cache.

## Why it matters

Your login, the file type and how long to keep a copy all ride in headers. Many bugs hide there.

## Common mistake

Forgetting Content-Type on a request with a JSON body. The server may not read the body at all.

## Three principles

- **Name and value.** One per line.
- **About the message.** Not the message itself.
- **Both ways.** Requests and responses.

## Related terms

- [HTTP Request](https://learn.benibix.com/term/infrastructure/http-request)
- [HTTP Response](https://learn.benibix.com/term/infrastructure/http-response)
- [Request Body](https://learn.benibix.com/term/infrastructure/request-body)
- [REST API](https://learn.benibix.com/term/development/rest-api)
- [Media Type (MIME Type)](https://learn.benibix.com/term/development/mime-type)

## Taught in

- [Cookies and Local Storage](https://learn.benibix.com/learn/development-web/cookies-and-local-storage): HTML, CSS and JS, 14/14
- [HTTP Requests and Responses](https://learn.benibix.com/learn/infrastructure-networking/http-requests-and-responses): Computer Networking, 9/13

---

Source: https://learn.benibix.com/term/infrastructure/http-header
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
