HttpContentMultipartExtensions.ReadAsMultipartAsync Method (HttpContent, CancellationToken)
Reads all body parts within a MIME multipart message and produces a set of HttpContent instances as a result.
Namespace: System.Net.Http
Assembly: System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)
Syntax
'Declaration
<ExtensionAttribute> _
Public Shared Function ReadAsMultipartAsync ( _
content As HttpContent, _
cancellationToken As CancellationToken _
) As Task(Of MultipartMemoryStreamProvider)
'Usage
Dim content As HttpContent
Dim cancellationToken As CancellationToken
Dim returnValue As Task(Of MultipartMemoryStreamProvider)
returnValue = content.ReadAsMultipartAsync(cancellationToken)
public static Task<MultipartMemoryStreamProvider> ReadAsMultipartAsync(
this HttpContent content,
CancellationToken cancellationToken
)
[ExtensionAttribute]
public:
static Task<MultipartMemoryStreamProvider^>^ ReadAsMultipartAsync(
HttpContent^ content,
CancellationToken cancellationToken
)
static member ReadAsMultipartAsync :
content:HttpContent *
cancellationToken:CancellationToken -> Task<MultipartMemoryStreamProvider>
public static function ReadAsMultipartAsync(
content : HttpContent,
cancellationToken : CancellationToken
) : Task<MultipartMemoryStreamProvider>
Parameters
- content
Type: HttpContent
An existing HttpContent instance to use for the object's content.
- cancellationToken
Type: System.Threading.CancellationToken
The token to cancel the operation.
Return Value
Type: System.Threading.Tasks.Task<MultipartMemoryStreamProvider>
A Task<TResult> representing the tasks of getting the collection of HttpContent instances where each instance represents a body part.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type HttpContent. When you use instance method syntax to call this method, omit the first parameter. For more information, see https://msdn.microsoft.com/en-us/library/bb384936(v=vs.118) or https://msdn.microsoft.com/en-us/library/bb383977(v=vs.118).