System.Uri has Host, Authority, and DnsSafeHost. MS provides a nice example of when Host and DnsSafeHost are different here.
I'd like a similar example/explanation for Host and Authority.
System.Uri has Host, Authority, and DnsSafeHost. MS provides a nice example of when Host and DnsSafeHost are different here.
I'd like a similar example/explanation for Host and Authority.
From MSDN URI.Host page.
Unlike the Authority property, this property value does not include the port number.
Every HTTP URL conforms to the syntax of a generic URI. The URI generic syntax consists of a hierarchical sequence of five components:
URI = scheme:[//authority]path[?query][#fragment]
where the authority component divides into three subcomponents:
authority = [userinfo@]host[:port]
Like this:
An optional authority component preceded by two slashes (//), comprising:
For more details, you can refer to https://en.wikipedia.org/wiki/URL .
According to the documentation you linked to, the Authority property will include the port number if it is not the same as the default port of the Uri, while the Host property will only return the DNS Host name or IP Address.
I don't believe there are any more differences than that.