Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Host

我们的志愿者还没有将这篇文章翻译为 中文 (简体)加入我们帮助完成翻译!

The Host request header specifies the domain name of the server (for virtual hosting), and (optionally) the TCP port number on which the server is listening.

If no port is given, the default port for the service requested (e.g., "80" for an HTTP URL) is implied.

A Host header field must be sent in all HTTP/1.1 request messages. A 400 (Bad Request) status code will be sent to any HTTP/1.1 request message that lacks a Host header field or contains more than one.

Header type Request header
Forbidden header name yes

Syntax

Host: <host>:<port>

Directives

<host>
the domain name of the server (for virtual hosting).
<port> Optional
TCP port number on which the server is listening.

Examples

Host: developer.cdn.mozilla.net

Specifications

Specification Title
RFC 7230, section 5.4: Host Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing

Browser compatibility

Feature Chrome Edge Firefox Internet Explorer Opera Safari Servo
Basic Support(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
Feature Android Chrome for Android Edge Mobile Firefox for Android IE Mobile Opera Mobile Safari Mobile
Basic Support(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)

See also

文档标签和贡献者

标签: 
 此页面的贡献者: fscholz
 最后编辑者: fscholz,