HttpWebResponse.ResponseUri Property
Gets the URI of the Internet resource that responded to the request.
Assembly: System (in System.dll)
| Exception | Condition |
|---|---|
| ObjectDisposedException | The current instance has been disposed. |
The ResponseUri property contains the URI of the Internet resource that actually responded to the request. This URI might not be the same as the originally requested URI, if the original server redirected the request.
The ResponseUri property will use the Content-Location header if present.
Applications that need to access the last redirected ResponseUri should use the HttpWebRequest.Address property rather than ResponseUri, since the use of ResponseUri property may open security vulnerabilities.
This example creates a HttpWebRequest and queries for an HttpWebResponse and then checks to see whether the original URI was redirected by the server.
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.