System.Net.WebRequest.EndGetResponse Method

When overridden in a descendant class, returns a System.Net.WebResponse.

Syntax

public virtual WebResponse EndGetResponse (IAsyncResult asyncResult)

Parameters

asyncResult
An IAsyncResult that references a pending request for a response.

Returns

A System.Net.WebResponse that contains a response to the Internet request.

Exceptions

TypeReason
NotSupportedExceptionThis method is not overridden in the derived class.
ArgumentException asyncResult was not returned by a call to WebRequest.BeginGetResponse(AsyncCallback, object).
ArgumentNullException asyncResult is a null reference.
InvalidOperationException

The WebRequest.ContentLength property of the current instance is greater than zero but no data has been written to the request stream.

-or-

This method was called previously using asyncResult.

System.Net.WebExceptionAn error occurred while processing the request.

Remarks

The WebRequest.EndGetResponse(IAsyncResult) method completes an asynchronous request for an Internet resource that was started with the WebRequest.BeginGetResponse(AsyncCallback, object) method.

Note:

The System.Net.WebRequest class is an abstract class. The actual behavior of System.Net.WebRequest instances at run time is determined by the descendant class returned by the WebRequest.Create(Uri) method. For more information about default values and exceptions, see the documentation for the descendant classes, such as System.Net.HttpWebRequest and System.Net.FileWebRequest.

Requirements

Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0