FileWebRequest.BeginGetRequestStream Method (AsyncCallback, Object)


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

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

[<HostProtectionAttribute(SecurityAction.LinkDemand, ExternalThreading = true)>]
override BeginGetRequestStream : 
        callback:AsyncCallback *
        state:Object -> IAsyncResult


Type: System.AsyncCallback

The AsyncCallback delegate.

Type: System.Object

An object that contains state information for this request.

Return Value

Type: System.IAsyncResult

An IAsyncResult that references the asynchronous request.

Exception Condition

The Method property is GET and the application writes to the stream.


The stream is being used by a previous call to BeginGetRequestStream.


No write stream is available.


The FileWebRequest was aborted.

The BeginGetRequestStream method starts an asynchronous request for a stream used to send data to a file system resource. The callback method that implements the AsyncCallback delegate uses the EndGetRequestStream method to return the request stream.

The following code example uses BeginGetRequestStream to make an asynchronous request for a Stream object.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top