HttpMultipartContent HttpMultipartContent HttpMultipartContent HttpMultipartContent HttpMultipartContent Class


Provides HTTP content that uses the multipart/* MIME type.

public : sealed class HttpMultipartContent : IClosable, IStringable, IHttpContent
struct winrt::Windows::Web::Http::HttpMultipartContent : IClosable, IStringable, IHttpContent
public sealed class HttpMultipartContent : IDisposable, IStringable, IHttpContent
Public NotInheritable Class HttpMultipartContent Implements IDisposable, IStringable, IHttpContent
var httpMultipartContent = new httpMultipartContent(subtype);

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)


Enumerating the collection in C# or Microsoft Visual Basic

You can iterate through an HttpMultipartContent object in C# or Microsoft Visual Basic. In many cases, such as using foreach syntax, the compiler does this casting for you and you won't need to cast to IEnumerable<IHttpContent> explicitly. If you do need to cast explicitly, for example if you want to call GetEnumerator, cast to IEnumerable with an IHttpContent constraint.


HttpMultipartContent() HttpMultipartContent() HttpMultipartContent() HttpMultipartContent() HttpMultipartContent()

Initializes a new instance of the HttpMultipartContent class.

HttpMultipartContent(String) HttpMultipartContent(String) HttpMultipartContent(String) HttpMultipartContent(String) HttpMultipartContent(String)

Initializes a new instance of the HttpMultipartContent class with the specified MIME subtype.

HttpMultipartContent(String, String) HttpMultipartContent(String, String) HttpMultipartContent(String, String) HttpMultipartContent(String, String) HttpMultipartContent(String, String)

Initializes a new instance of the HttpMultipartContent class with the specified MIME subtype and boundary string.


Headers Headers Headers Headers Headers

Get a collection of content headers set on the HttpMultipartContent.


Add(IHttpContent) Add(IHttpContent) Add(IHttpContent) Add(IHttpContent) Add(IHttpContent)

Add HTTP content to the HttpMultipartContent instance.

BufferAllAsync() BufferAllAsync() BufferAllAsync() BufferAllAsync() BufferAllAsync()

Serialize the HttpMultipartContent into memory as an asynchronous operation.

Close() Close() Close() Close() Close()

Closes the HttpMultipartContent instance and releases allocated resources.

Dispose() Dispose() Dispose() Dispose() Dispose()

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

First() First() First() First() First()

Gets an object that can be used to enumerate the contents in the HttpMultipartContent object.

ReadAsBufferAsync() ReadAsBufferAsync() ReadAsBufferAsync() ReadAsBufferAsync() ReadAsBufferAsync()

Serialize the HttpMultipartContent to a buffer as an asynchronous operation.

ReadAsInputStreamAsync() ReadAsInputStreamAsync() ReadAsInputStreamAsync() ReadAsInputStreamAsync() ReadAsInputStreamAsync()

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

ReadAsStringAsync() ReadAsStringAsync() ReadAsStringAsync() ReadAsStringAsync() ReadAsStringAsync()

Serialize the HttpMultipartContent to a String as an asynchronous operation.

ToString() ToString() ToString() ToString() ToString()

Returns a string that represents the current HttpMultipartContent object.

TryComputeLength(UInt64) TryComputeLength(UInt64) TryComputeLength(UInt64) TryComputeLength(UInt64) TryComputeLength(UInt64)

Determines whether the HttpMultipartContent has a valid length in bytes.

WriteToStreamAsync(IOutputStream) WriteToStreamAsync(IOutputStream) WriteToStreamAsync(IOutputStream) WriteToStreamAsync(IOutputStream) WriteToStreamAsync(IOutputStream)

Write the HttpMultipartContent to an output stream as an asynchronous operation.

See also