HTTP Host Header
Specifies the domain name of the server and optionally the TCP port number. Mandatory in HTTP/1.1 requests.
Purpose
Allows a single server to host multiple websites (virtual hosting) by telling the server which domain is being requested.
Host: <host>:<port> Example: Host: api.example.com Example: Host: api.example.com:8080
Code Examples
See how to use the Host header in different tools and languages.
Related Headers
Origin
Indicates where the request originates from. Used in CORS to determine if the server allows cross-origin requests.
Referer
Contains the address of the previous page from which the current page was requested. Used for analytics, logging, and cache optimization.
X-Forwarded-For
Identifies the originating IP address of a client connecting through a proxy or load balancer. The standard Forwarded header is preferred in modern applications.