Skip to main content
HttpMultipartContent class

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

Syntax


var httpMultipartContent = new Windows.Web.Http.HttpMultipartContent(string);
var httpMultipartContent = new Windows.Web.Http.HttpMultipartContent(string, string);
var httpMultipartContent = new Windows.Web.Http.HttpMultipartContent();

public sealed class HttpMultipartContent : IHttpContent,
    IDisposable,
    IStringable,
    IEnumerable<IHttpContent>

Public NotInheritable Class HttpMultipartContent
    Implements IHttpContent, _
    IDisposable, _
    IStringable, _
    IEnumerable(Of IHttpContent)

public ref class HttpMultipartContent sealed : IHttpContent,
    IClosable,
    IStringable,
    IIterable<IHttpContent>

Members

The HttpMultipartContent class has these types of members:

Constructors

The HttpMultipartContent class has these constructors.

ConstructorDescription
HttpMultipartContent() Initializes a new instance of the HttpMultipartContent class.
HttpMultipartContent(String) Initializes a new instance of the HttpMultipartContent class with the specified MIME subtype.
HttpMultipartContent(String, String) Initializes a new instance of the HttpMultipartContent class with the specified MIME subtype and boundary string.

 

Methods

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

MethodDescription
Add Add HTTP content to the HttpMultipartContent instance.
BufferAllAsync Serialize the HttpMultipartContent into memory as an asynchronous operation.
Close [C++, JavaScript]Closes the HttpMultipartContent instance and releases allocated resources.
Dispose [C#, VB]Performs tasks associated with freeing, releasing, or resetting unmanaged resources.
First [C++, JavaScript]Gets an object that can be used to enumerate the contents in the HttpMultipartContent object.
ReadAsBufferAsync Serialize the HttpMultipartContent to a buffer as an asynchronous operation.
ReadAsInputStreamAsync Serialize the HttpMultipartContent and return an input stream that represents the content as an asynchronous operation.
ReadAsStringAsync Serialize the HttpMultipartContent to a String as an asynchronous operation.
ToString Returns a string that represents the current HttpMultipartContent object.
TryComputeLength Determines whether the HttpMultipartContent has a valid length in bytes.
WriteToStreamAsync Write the HttpMultipartContent to an output stream as an asynchronous operation.

 

Properties

The HttpMultipartContent class has these properties.

PropertyAccess typeDescription

Headers

Read-only

Get a collection of content headers set on the HttpMultipartContent.

 

Remarks

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<T> with an IHttpContent constraint.

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
IIterable(IHttpContent)
IStringable
Object