Open In App
Related Articles

HTTP headers | Host

Improve Article
Improve
Save Article
Save
Like Article
Like

The HTTP Host represents the domain name of the server. It may also represent the Transmission Control Protocol (TCP) port number which the server uses. Defining the port number is optional, the default value is considered. For example, “80” is assigned as the port number for an HTTP URL when there is no port number specified. The HTTP Host header is a request type header. The host header field must be sent in all HTTP/1.1 request messages. If a request message does not have any header field or more than one header field, a 400 Bad Request is sent.

Syntax :

Host: <host>:<port>

Directives: The HTTP header Host accepts two directives mentioned above and described below:

  • <host>: This directive represents the domain name of the server.
  • <port>: This directive is an optional one. It represents the TCP port number in which the server is working.
  • Note: You can check any website hoster in this link.
    Examples:

    • Host for GeeksforGeeks cdn page.
      Host: www.cdn.geeksforgeeks.org
    • Host for GeeksforGeeks home page.
      Host: www.geeksforgeeks.org

    Supported Browsers: The browsers compatible with HTTP Host header are listed below:

    • Google Chrome
    • Internet Explorer
    • Edge
    • Mozilla Firefox
    • Opera
    • Safari
    Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

    Last Updated : 20 Nov, 2019
    Like Article
    Save Article
    Previous
    Next
    Similar Reads
    Complete Tutorials