GetRequestStream Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

When overridden in a descendant class, returns a Stream for writing data to the Internet resource.

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

public virtual Stream GetRequestStream()

Return Value

Type: System.IO..::..Stream
A Stream for writing data to the Internet resource.

The GetRequestStream method initiates a request to send data to the Internet resource and returns a Stream instance for sending data to the Internet resource.

The GetRequestStream method provides synchronous access to the Stream. For asynchronous access, use the BeginGetRequestStream and EndGetRequestStream methods.

NoteNote

The WebRequest class is an abstract class. The actual behavior of WebRequest instances at run time is determined by the descendant class returned by the WebRequest..::..Create method. For more information about default values and exceptions, see the documentation for the descendant classes, such as HttpWebRequest and FileWebRequest.

Show: