🌐HTTP Header
Also known as Header, Request Header, Response Header, HTTP Headers
A label on a web request or reply. Each has a name and a value.
Think of it like
Think of it like the notes on the outside of a parcel. Fragile, this way up, from Emma.
Example
Emma's app sends Authorization: Bearer with her token in a header. The server reads it and knows who she is.
Why it matters
Your login, the file type and how long to keep a copy all ride in headers. Many bugs hide there.
Definition
Example code
http
Content-Type: application/json
Accept-Language: en
Cache-Control: max-age=3600Common mistake
Key takeaways
- 1Name and value. One per line.
- 2About the message. Not the message itself.
- 3Both ways. Requests and responses.