Spec-Zone.ru › HTTP

Headers: Host

Host header

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

  • Learn more
  • See full compatibility
>

The HTTP 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 is implied (e.g., 443 for an HTTPS URL, and 80 for an HTTP URL).

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 or contains more than one Host header field.

Header type Request header
Forbidden request header 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.mozilla.org

Specifications

Specification
HTTP Semantics>
# field.host>

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS
Host 1 12 1 15 1 18 4 14 1 1.0 4.4 1

See also

  • 400
  • <base>

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Host

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API