This documentation is archived and is not being maintained.

HttpWebRequest.Address Property

Gets the URI of the Internet resource that actually responds to the request.

[Visual Basic]
Public ReadOnly Property Address As Uri
public Uri Address {get;}
public: __property Uri* get_Address();
public function get Address() : Uri;

Property Value

A Uri identifying 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 that actually responds to a request, after any redirections that might happen during the request are complete.

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


The following example checks to see if the HttpWebRequest instance 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.

[Visual Basic] 
Dim hasChanged As Boolean = _
   (req.RequestUri.ToString() <> req.Address.ToString())

bool hasChanged = (req.RequestUri != req.Address);

bool hasChanged = req->RequestUri->Equals(req->Address);

var hasChanged : Boolean = (req.RequestUri.ToString() != req.Address.ToString())


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

HttpWebRequest Class | HttpWebRequest Members | System.Net Namespace