Share via


GetRequestStream Method

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

Gets a Stream object to use to write request data.

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

Syntax

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

Return Value

Type: System.IO. . :: . .Stream
A Stream to use to write request data.

Remarks

The GetRequestStream method returns a stream to use to send data for the HttpWebRequest. After the Stream object has been returned, you can send data with the HttpWebRequest by using the Stream..::..Write method.

If an application needs to set the value of the ContentLength property, then this must be done before retrieving the stream.

You must call the Stream..::..Close method to close the stream and release the connection for reuse. Failure to close the stream causes your application to run out of connections.

.NET Framework Security

See Also

Reference

HttpWebRequest Class

System.Net Namespace