Host - HTTP 编辑
The Host
request header specifies the host and port number of the server to which the request is being sent.
If no port is included, the default port for the service requested (e.g., 443
for an HTTPS URL, and 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 may be sent to any HTTP/1.1 request message that lacks a Host
header field or that 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
BCD tables only load in the browser
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论