This documentation is archived and is not being maintained.

HttpWebRequest.Address Property

Gets the Uniform Resource Identifier (URI) of the Internet resource that actually responds to the request.

Namespace:  System.Net
Assembly:  System (in System.dll)

Public ReadOnly Property Address As Uri

Property Value

Type: System.Uri
A Uri that identifies the Internet resource that actually responds to the request. The default is the URI used by the WebRequest.Create method to initialize the request.

The Address property is set to the URI after any redirections that happen during the request are complete.

The URI of the original request is kept in the RequestUri property.

The following code example checks to see if the HttpWebRequest object req was redirected to another location to fulfill the request, and sets the value of the hasChanged variable to true if the request was redirected; otherwise hasChanged is set to false.

 Dim hasChanged As Boolean = _
    (req.RequestUri.ToString() <> req.Address.ToString())

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.