Export (0) Print
Expand All

HttpWebRequest.AllowWriteStreamBuffering Property

When overridden in a descendant class, gets or sets a value that indicates whether to buffer the data written to the Internet resource.

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

public virtual bool AllowWriteStreamBuffering { get; set; }

Property Value

Type: System.Boolean
true to enable buffering of the data written to the Internet resource; false to disable buffering. The default is true.

ExceptionCondition
NotImplementedException

This property is not implemented.

NotSupportedException

This property cannot be set to false on the browser stack.

When AllowWriteStreamBuffering is true, the data is buffered in memory so it can be written more efficiently to the Internet resource in larger chunks. This property provides support for determining upload progress.

The AllowWriteStreamBuffering property is supported by both the browser and client HTTP stack. However on the browser stack, the AllowWriteStreamBuffering property can only be set to true and will throw NotSupportedException if set to false.

The AllowWriteStreamBuffering property affects when the callback from BeginGetRequestStream method is called. When the AllowWriteStreamBuffering property is true, the callback is raised immediately before any data is sent. When the AllowWriteStreamBuffering property is false, the callback is raised only after the headers are sent and then all writes to the stream are immediately sent to the server.

If the application derives a class from HttpWebRequest and does not override the AllowWriteStreamBuffering property and then tries to get or set the AllowWriteStreamBuffering property, a NotImplementedException is thrown.

If an application implements a custom WebRequest class and does not override the AllowWriteStreamBuffering property, then the NotImplementedException is thrown.

Silverlight

Supported in: 5, 4

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft