Host
The host and optional port of the target server. Required in HTTP/1.1 for virtual hosting.
RequestSyntax
Host: <host>[:<port>]Example values
| Value | Explanation |
|---|---|
| api.example.com | Hostname |
| localhost:3000 | With port |
cURL usage
curl https://api.example.com # Host set automatically
Common mistakes
Sending wrong Host for virtual hosts; missing in HTTP/1.0.