Click or drag to resize
MimeKit

MimeEntityLoadAsync(ParserOptions, ContentType, Stream, CancellationToken) Method

Asynchronously load a MimeEntity from the specified content stream.

Namespace: MimeKit
Assembly: MimeKit (in MimeKit.dll) Version: 4.7.1
Syntax
C#
public static Task<MimeEntity> LoadAsync(
	ParserOptions options,
	ContentType contentType,
	Stream content,
	CancellationToken cancellationToken = default
)

Parameters

options  ParserOptions
The parser options.
contentType  ContentType
The Content-Type of the stream.
content  Stream
The content stream.
cancellationToken  CancellationToken  (Optional)
The cancellation token.

Return Value

TaskMimeEntity
The parsed MIME entity.
Exceptions
ExceptionCondition
ArgumentNullException

options is null.

-or-

contentType is null.

-or-

content is null.

OperationCanceledException The operation was canceled via the cancellation token.
FormatException There was an error parsing the entity.
IOException An I/O error occurred.
Remarks
This method is mostly meant for use with APIs such as HttpWebResponse where the headers are parsed separately from the content.
See Also