Skip to main content
HttpBufferContent class

Provides HTTP content that uses a buffer.

Syntax


var httpBufferContent = new Windows.Web.Http.HttpBufferContent(iBuffer);
var httpBufferContent = new Windows.Web.Http.HttpBufferContent(iBuffer, uInt32, uInt32);

public sealed class HttpBufferContent : IHttpContent,
    IDisposable,
    IStringable

Public NotInheritable Class HttpBufferContent
    Implements IHttpContent, _
    IDisposable, _
    IStringable

public ref class HttpBufferContent sealed : IHttpContent,
    IClosable,
    IStringable

Members

The HttpBufferContent class has these types of members:

Constructors

The HttpBufferContent class has these constructors.

ConstructorDescription
HttpBufferContent(IBuffer) Initializes a new instance of the HttpBufferContent class with the specified buffer.
HttpBufferContent(IBuffer, UInt32, UInt32) Initializes a new instance of the HttpBufferContent class with an offset and count of bytes from the specified buffer.

 

Methods

The HttpBufferContent class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
BufferAllAsync Serialize the HttpBufferContent into memory as an asynchronous operation.
Close [C++, JavaScript]Closes the HttpBufferContent instance and releases allocated resources.
Dispose [C#, VB]Performs tasks associated with freeing, releasing, or resetting unmanaged resources.
ReadAsBufferAsync Serialize the HttpBufferContent to a buffer as an asynchronous operation.
ReadAsInputStreamAsync Serialize the HttpBufferContent and return an input stream that represents the content as an asynchronous operation.
ReadAsStringAsync Serialize the HttpBufferContent to a String as an asynchronous operation.
ToString Returns a string that represents the current HttpBufferContent object.
TryComputeLength Computes the HttpBufferContent length in bytes.
WriteToStreamAsync Write the HttpBufferContent to an output stream as an asynchronous operation.

 

Properties

The HttpBufferContent class has these properties.

PropertyAccess typeDescription

Headers

Read-only

Get a collection of content headers set on the HttpBufferContent.

 

Remarks

When sending (POST method) an HttpBufferContent class, the HttpProgress.BytesSent value jumps from 0% bytes sent to 100% bytes sent in one progress event, because the whole buffer is moved to lower network APIs all at once. For more detailed progress, use HttpStreamContent instead of HttpBufferContent, because streams are read and sent in smaller chunks, resulting in more progress events. E.g. 0 bytes sent, 65536 bytes sent, 131072 bytes sent, etc.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Web.Http
Windows::Web::Http [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8.1 [Windows Store apps, desktop apps]

Minimum supported server

Windows Server 2012 R2 [Windows Store apps, desktop apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Web.Http
Windows::Web::Http [C++]

Metadata

Windows.winmd

Attributes

[ DualApiPartition()]
[ MarshalingBehavior(Agile)]
[ Threading(Both)]
[ Version(0x06030000)]

See also

IClosable
IHttpContent
IStringable
Object