Share via


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)

Syntax

'Declaration
Public Overridable Function GetRequestStream As Stream
public virtual Stream GetRequestStream()
public:
virtual Stream^ GetRequestStream()
abstract GetRequestStream : unit -> Stream 
override GetRequestStream : unit -> Stream 
public function GetRequestStream() : Stream

Return Value

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

Remarks

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.

Note

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.

.NET Framework Security

See Also

Reference

WebRequest Class

System.Net Namespace