Skip to content
Back to Path
Module 4 of 18

HTTP Headers (Overview)

Headers are the "Settings" of an HTTP message. They allow the client and server to share extra information without putting it in the main content.

Interactive Protocol Simulation
Step 1 / 4

Step 1 of 4

User-Agent:Browser Info
Mozilla/5.0...
Accept:Preference
text/html
Host:Destination
example.com
Cookie:Identity
session_id=123

Syntax

Header-Name: Value

Worked example

Request

User-Agent: Mozilla/5.0
Accept-Language: en-US

The User-Agent header tells the server which browser you are using, so it can serve the best version of the site for your device.

The Purpose of Headers

Headers handle everything from security and caching to language preferences and cookie management. They are key-value pairs separated by a colon.

Four Categories

Headers are generally grouped into four types:

  • General Headers — Apply to both requests and responses (e.g., Date).
  • Request Headers — Client info (e.g., User-Agent).
  • Response Headers — Server info (e.g., Server).
  • Entity Headers — Info about the body content (e.g., Content-Length).

Study kit

Module 4 of 18

Beginner · 2 min · 0 of 18 complete

Module status

Not completed yet

Notessaved locally+

Notes stay in this browser. They are not uploaded.

Suggest an edit

Discussion

0 comments

Loading discussion…

Sign in to ask a question.