IHttpContent Interface

Definition

Provides a base interface for an HTTP entity body and content headers.

public interface class IHttpContent : IClosable
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.Guid(1796514881, 64423, 19410, 175, 10, 131, 157, 231, 194, 149, 218)]
struct IHttpContent : IClosable
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.Guid(1796514881, 64423, 19410, 175, 10, 131, 157, 231, 194, 149, 218)]
public interface IHttpContent : System.IDisposable
Public Interface IHttpContent
Implements IDisposable
Derived
Attributes
Implements

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Remarks

The contents of an HTTP message corresponds to the entity body and headers associated with the content defined in RFC 2616. Several classes and an interface in the Windows.Web.Http namespace can be used for HTTP content, including:

  • IHttpContent - A base interface for developers to create their own content objects. It represents an HTTP entity body and content headers. This interface has methods that get and set the actual content data. It also provides properties that get and set content related headers.
  • HttpBufferContent - HTTP content that uses a buffer.
  • HttpFormUrlEncodedContent - HTTP content that uses name/value tuples encoded with the application/x-www-form-urlencoded MIME type.
  • HttpMultipartContent - HTTP content that uses multipart/* MIME type.
  • HttpMultipartFormDataContent - HTTP content that uses the encoded multipart/form-data MIME type.
  • HttpStreamContent - HTTP content that uses a stream. This content type is used by the HTTP methods to receive data and HTTP methods to upload data.
  • HttpStringContent - HTTP content that uses a string.

Properties

Headers

Get a collection of content headers set on the IHttpContent.

Methods

BufferAllAsync()

Serialize the HTTP content into memory as an asynchronous operation.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

ReadAsBufferAsync()

Serialize the HTTP content to a buffer as an asynchronous operation.

ReadAsInputStreamAsync()

Serialize the HTTP content and return an input stream that represents the content as an asynchronous operation.

ReadAsStringAsync()

Serialize the HTTP content to a String as an asynchronous operation.

TryComputeLength(UInt64)

Determines whether the HTTP content has a valid length in bytes.

WriteToStreamAsync(IOutputStream)

Write the HTTP content to an output stream as an asynchronous operation.

Applies to

See also