When overridden in a descendant class, returns a System.IO.Stream for writing data to the Internet resource.
- asyncResult
- An IAsyncResult that references a pending request for a stream.
A System.IO.Stream to write data to.
Type Reason NotSupportedException This method is not overridden in the derived class. ArgumentException asyncResult was not returned by a call to WebRequest.BeginGetRequestStream(AsyncCallback, object). ArgumentNullException asyncResult is a null reference. InvalidOperationException This method was called previously using asyncResult.
-or-
No stream is available.
System.Net.WebException An error occurred while processing the request.
The WebRequest.EndGetRequestStream(IAsyncResult) method completes an asynchronous stream request that was started by the WebRequest.BeginGetRequestStream(AsyncCallback, object) method.
To avoid timing issues with garbage collection, be sure to close the response stream by calling the System.IO.Stream.Close method on the stream returned by WebResponse.GetResponseStream after calling WebRequest.EndGetResponse(IAsyncResult).
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.