HttpMultipartFormDataContent 类

定义

提供使用 多部分/表单数据 MIME 类型的 HTTP 内容。

public ref class HttpMultipartFormDataContent sealed : IIterable<IHttpContent ^>, IClosable, IStringable, IHttpContent
/// [Windows.Foundation.Metadata.Activatable(Windows.Web.Http.IHttpMultipartFormDataContentFactory, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class HttpMultipartFormDataContent final : IIterable<IHttpContent>, IClosable, IStringable, IHttpContent
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Activatable(Windows.Web.Http.IHttpMultipartFormDataContentFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class HttpMultipartFormDataContent final : IIterable<IHttpContent>, IClosable, IStringable, IHttpContent
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Web.Http.IHttpMultipartFormDataContentFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class HttpMultipartFormDataContent : IEnumerable<IHttpContent>, System.IDisposable, IStringable, IHttpContent
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Web.Http.IHttpMultipartFormDataContentFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class HttpMultipartFormDataContent : IEnumerable<IHttpContent>, System.IDisposable, IStringable, IHttpContent
function HttpMultipartFormDataContent(boundary)
Public NotInheritable Class HttpMultipartFormDataContent
Implements IDisposable, IEnumerable(Of IHttpContent), IHttpContent, IStringable
继承
Object Platform::Object IInspectable HttpMultipartFormDataContent
属性
实现

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

注解

枚举 C# 或 Microsoft Visual Basic 中的集合

可以在 C# 或 Microsoft Visual Basic 中循环访问 HttpMultipartFormDataContent 对象。 在许多情况下,例如使用 foreach 语法,编译器会为你执行此强制转换,你无需显式强制转换为 IEnumerable<IHttpContent> 。 如果需要显式强制转换(例如,如果要调用 GetEnumerator),请使用 IHttpContent 约束强制转换为 [IEnumerable<T>] (/dotnet/api/system.collections.generic.ienumerable-1?view=dotnet-uwp-10.0&preserve-view=true。

构造函数

HttpMultipartFormDataContent()

初始化 HttpMultipartFormDataContent 类的新实例。

HttpMultipartFormDataContent(String)

使用指定的边界字符串初始化 HttpMultipartFormDataContent 类的新实例。

属性

Headers

获取 在 HttpMultipartFormDataContent 上设置的内容标头的集合。

方法

Add(IHttpContent)

将 HTTP 内容添加到 HttpMultipartFormDataContent 实例。

Add(IHttpContent, String)

将具有指定名称的 HTTP 内容添加到 HttpMultipartFormDataContent 实例。

Add(IHttpContent, String, String)

将具有指定名称的 HTTP 内容从文件添加到 HttpMultipartFormDataContent 实例。

BufferAllAsync()

HttpMultipartFormDataContent 作为异步操作序列化到内存中。

Close()

关闭 HttpMultipartFormDataContent 实例并释放分配的资源。

Dispose()

执行与释放或重置非托管资源关联的应用程序定义的任务。

First()

获取一个对象,该对象可用于枚举 HttpMultipartFormDataContent 对象中的内容。

ReadAsBufferAsync()

HttpMultipartFormDataContent 作为异步操作序列化到缓冲区。

ReadAsInputStreamAsync()

序列化 HttpMultipartFormDataContent 并返回一个输入流,该流将内容表示为异步操作。

ReadAsStringAsync()

HttpMultipartFormDataContent 序列化为 字符串 作为异步操作。

ToString()

返回一个表示当前 HttpMultipartFormDataContent 对象的字符串。

TryComputeLength(UInt64)

确定 HttpMultipartFormDataContent 是否具有有效的字节长度。

WriteToStreamAsync(IOutputStream)

HttpMultipartFormDataContent 作为异步操作写入输出流。

适用于

另请参阅