Mono Class Library: System.Net.WebRequest Overview | Members

System.Net.WebRequest.BeginGetResponse Method

Begins sending the current request asynchronously. [Edit]

public virtual IAsyncResult BeginGetResponse (AsyncCallback callback, object state)

Parameters

callback
A AsyncCallback delegate to be called when the response from the server is available. [Edit]
state
A object containing state information for the asynchronous request. [Edit]

Returns

A IAsyncResult object that contains information about the asynchronous operation. [Edit]

Exceptions

TypeReason
NotSupportedExceptionThis method is not overridden in the derived class. [Edit]

Remarks

The state parameter can be any object that the caller wishes to have available for the duration of the asynchronous operation. This object is available via the IAsyncResult.AsyncState property of the object returned by this method.

Operation

This method starts an asynchronous operation to send the current request and receive the response from the server that processed the request. To get the response, call the WebRequest.EndGetResponse(IAsyncResult) method and specify the IAsyncResult object returned by this method.

If the callback parameter is not null , the method referenced by callback is invoked when the asynchronous operation completes. The IAsyncResult object returned by this method is passed as the argument to the method referenced by callback.

The System.Net.WebRequest class is abstract and does not provide an implementation for this method. This method throws NotSupportedException.

Note to Inheritors
This method must be overridden by classes that inherit from System.Net.WebRequest to provide this functionality.

Usage
The WebRequest.BeginGetResponse(AsyncCallback, object) method starts an asynchronous request for a response. The callback delegate can call the WebRequest.EndGetResponse(IAsyncResult) method to return the System.Net.WebResponse received from the resource. [Edit]

Requirements

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