WebException.Response Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets the response that the remote host returned.
Assembly: System.Net (in System.Net.dll)
Property Value
Type: System.Net.WebResponseIf a response is available from the Internet resource, a WebResponse instance that contains the error response from an Internet resource; otherwise, Nothing.
Some Internet protocols, such as HTTP, return otherwise valid responses indicating that an error has occurred at the protocol level. When the response to an Internet request indicates an error, WebRequest.BeginGetResponse initiates a request for a response and WebRequest.EndGetResponse sets the Status property and provides the WebResponse that contains the error message in the Response property of the WebException that was thrown. The application can examine the WebResponse to determine the actual error.
When Status is UnknownError, additional details about the protocol specific response error may be available using the Response property. If the Response property is not null, this indicates that the remote server responded with an error code. In this case, the Response property can be queried for more specific information about the response.