Back to HTTP Headers
Request

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.

curl -H "Host: api.example.com" https://203.0.113.1/resource
# For virtual hosting — send host header to specific IP

Related Headers

Test Your APIs

host headerhttp hosthttp headers guide