.NET Framework Class Library for Silverlight
HttpWebRequest..::.BeginGetRequestStream Method

Begins an asynchronous request for a Stream object to use to write data.

Namespace:  System.Net
Assembly:  System.Net (in System.Net.dll)
Syntax

Visual Basic (Declaration)
Public Overrides Function BeginGetRequestStream ( _
    callback As AsyncCallback, _
    state As Object _
) As IAsyncResult
Visual Basic (Usage)
Dim instance As HttpWebRequest
Dim callback As AsyncCallback
Dim state As Object
Dim returnValue As IAsyncResult

returnValue = instance.BeginGetRequestStream(callback, _
    state)
C#
public override IAsyncResult BeginGetRequestStream(
    AsyncCallback callback,
    Object state
)

Parameters

callback
Type: System..::.AsyncCallback
The AsyncCallback delegate.
state
Type: System..::.Object
The state object for this request.

Return Value

Type: System..::.IAsyncResult
An IAsyncResult that references the asynchronous request.
Exceptions

ExceptionCondition
ProtocolViolationException

The Method property is GET.

InvalidOperationException

The stream is being used by a previous call to BeginGetRequestStream

-or-

The thread pool is running out of threads.

NotImplementedException

This method is not implemented.

NotSupportedException

The request cache validator indicated that the response for this request can be served from the cache; however, requests that write data must not use the cache. This exception can occur if you are using a custom cache validator that is incorrectly implemented.

WebException

Abort was previously called.

ObjectDisposedException

In a .NET Framework application, a request stream with zero content length was not obtained and closed correctly.

Remarks

The BeginGetRequestStream method starts an asynchronous request for a stream used to send data for the HttpWebRequest. The asynchronous callback method uses the EndGetRequestStream method to return the actual stream.

You must use the BeginGetResponse method to retrieve the response. The IAsyncResult returned by the BeginGetResponse method does not support the AsyncWaitHandle property. If an application tries to access the AsyncWaitHandle property, a NotSupportedException is thrown.

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

See Also

Reference

Tags :


Page view tracker