System.Net.WebRequest.BeginGetResponse Method

When overridden in a descendant class, begins an asynchronous request for an Internet resource.

Syntax

public virtual IAsyncResult BeginGetResponse (AsyncCallback callback, object state)

Parameters

callback
The AsyncCallback delegate.
state
An object containing state information for this asynchronous request.

Returns

An IAsyncResult that references the asynchronous request.

Exceptions

TypeReason
NotSupportedExceptionThis method is not overridden in the derived class.

Remarks

The WebRequest.BeginGetResponse(AsyncCallback, object) method starts an asynchronous request for a response. The callback method that implements the AsyncCallback delegate uses the WebRequest.EndGetResponse(IAsyncResult) method to return the System.Net.WebResponse from the Internet resource.

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.

Note:

If a WebException is thrown, use the WebException.Response and WebException.Status properties of the exception to determine the response from the server.

Requirements

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