Mono Class Library: System.Net.HttpWebRequest Overview | MembersSystem.Net.HttpWebRequest.BeginGetRequestStream Method |
Begins an asynchronous request for a stream in which to write data to be sent in the current instance. [Edit]
|
- callback
- A AsyncCallback delegate to be called when the stream is available. Can be null . [Edit]
- state
- A object containing state information for the asynchronous request. Can be null . [Edit]
A IAsyncResult that contains information about the asynchronous operation. [Edit]
Type Reason InvalidOperationException The stream is being used by a previous call to HttpWebRequest.BeginGetRequestStream(AsyncCallback, object) .
-or-
No writeable stream is available.
[Edit]System.Net.ProtocolViolationException The HttpWebRequest.ContentLength property of the current instance is not set.
-or-
The HttpWebRequest.Method property of the current instance is "GET" or "HEAD".
[Edit]System.Net.WebException HttpWebRequest.Abort was previously called.
-or-
An error occurred while processing the request.
[Edit]
This method starts an asynchronous operation. To get the request stream, call the HttpWebRequest.EndGetRequestStream(IAsyncResult) method and specify the IAsyncResult object returned by this method.
Note: The HttpWebRequest.EndGetRequestStream(IAsyncResult) method should be called exactly once for each call to HttpWebRequest.BeginGetRequestStream(AsyncCallback, object).If the callback parameter is not null, the method(s) referenced by callback are invoked when the asynchronous operation completes. The IAsyncResult object returned by this method is passed as the argument to the method(s) referenced by callback .
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.
The value of the HttpWebRequest.ContentLength property of the current instance is required to be set prior to calling this method.
Note:[Edit]The method(s) invoked by the callback delegate can call the HttpWebRequest.EndGetRequestStream(IAsyncResult) method to retrieve the stream.
This method is the asynchronous version of the HttpWebRequest.GetRequestStream method.
This method overrides WebRequest.BeginGetRequestStream(AsyncCallback, object) .
Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0