Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MultipartFormDataContent Class

MultipartFormDataContent Class

.NET Framework 4.6 and 4.5

Provides a container for content encoded using multipart/form-data MIME type.

System.Object
  System.Net.Http.HttpContent
    System.Net.Http.MultipartContent
      System.Net.Http.MultipartFormDataContent

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

public class MultipartFormDataContent : MultipartContent

The MultipartFormDataContent type exposes the following members.

  NameDescription
Public methodMultipartFormDataContent()Creates a new instance of the MultipartFormDataContent class.
Public methodMultipartFormDataContent(String)Creates a new instance of the MultipartFormDataContent class.
Top

  NameDescription
Public propertyHeadersGets the HTTP content headers as defined in RFC 2616. (Inherited from HttpContent.)
Top

  NameDescription
Public methodAdd(HttpContent)Add HTTP content to a collection of HttpContent objects that get serialized to multipart/form-data MIME type. (Overrides MultipartContent.Add(HttpContent).)
Public methodAdd(HttpContent, String)Add HTTP content to a collection of HttpContent objects that get serialized to multipart/form-data MIME type.
Public methodAdd(HttpContent, String, String)Add HTTP content to a collection of HttpContent objects that get serialized to multipart/form-data MIME type.
Public methodCopyToAsync(Stream)Serialize the HTTP content into a stream of bytes and copies it to the stream object provided as the stream parameter. (Inherited from HttpContent.)
Public methodCopyToAsync(Stream, TransportContext)Serialize the HTTP content into a stream of bytes and copies it to the stream object provided as the stream parameter. (Inherited from HttpContent.)
Protected methodCreateContentReadStreamAsyncSerialize the HTTP content to a memory stream as an asynchronous operation. (Inherited from HttpContent.)
Public methodDispose()Releases the unmanaged resources and disposes of the managed resources used by the HttpContent. (Inherited from HttpContent.)
Protected methodDispose(Boolean)Releases the unmanaged resources used by the MultipartContent and optionally disposes of the managed resources. (Inherited from MultipartContent.)
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetEnumeratorReturns an enumerator that iterates through the collection of HttpContent objects that get serialized using the multipart/* content type specification.. (Inherited from MultipartContent.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodLoadIntoBufferAsync()Serialize the HTTP content to a memory buffer as an asynchronous operation. (Inherited from HttpContent.)
Public methodLoadIntoBufferAsync(Int64)Serialize the HTTP content to a memory buffer as an asynchronous operation. (Inherited from HttpContent.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodReadAsByteArrayAsyncSerialize the HTTP content to a byte array as an asynchronous operation. (Inherited from HttpContent.)
Public methodReadAsStreamAsyncSerialize the HTTP content and return a stream that represents the content as an asynchronous operation. (Inherited from HttpContent.)
Public methodReadAsStringAsyncSerialize the HTTP content to a string as an asynchronous operation. (Inherited from HttpContent.)
Protected methodSerializeToStreamAsyncSerialize the multipart HTTP content to a stream as an asynchronous operation. (Inherited from MultipartContent.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Protected methodTryComputeLengthDetermines whether the HTTP multipart content has a valid length in bytes. (Inherited from MultipartContent.)
Top

  NameDescription
Explicit interface implemetationPrivate methodIEnumerable.GetEnumeratorThe explicit implementation of the GetEnumerator method. (Inherited from MultipartContent.)
Top

This type is derived from MultipartContent type. All MultipartFormDataContent does is provide methods to add required Content-Disposition headers to content object added to the collection.

.NET Framework

Supported in: 4.6, 4.5

.NET for Windows Phone apps

Supported in: Windows Phone 8.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2015 Microsoft