Documentation for this section has not yet been entered.
The HttpWebRequest.Host property can be used to set the Host header value to use in an HTTP request independent from the request URI. The HttpWebRequest.Host property can consist of a hostname and an optional port number. A Host header without port information implies the default port for the service requested (port 80 for an HTTP URL, for example).
The format for specifying a host and port must follow the rules in section 14.23 of RFC2616 published by the IETF. An example complying with these requirements that specifies a port of 8080 would be the following value for the HttpWebRequest.Host property:
www.contoso.com:8080
Using the HttpWebRequest.Host property to explicitly specify a custom Host header value also affects areas caching, cookies, and authentication. When an application provides credentials for a specific URI prefix, the applications needs to make sure to use the URI containing the value of the Host header, not the target server in the URI. The key used when caching resources, uses the Host header value rather than the request URI. Cookies are stored in a System.Net.CookieContainer and logically grouped by the server domain name. If the application specifies a Host header, then this value will be used as domain.
If the HttpWebRequest.Host property is not set, then the Host header value to use in an HTTP request is based on the request URI.