HttpFormUrlEncodedContent 类

定义

提供使用 application/x-www-form-urlencoded MIME 类型编码的名称/值数据的 HTTP 内容。

public ref class HttpFormUrlEncodedContent sealed : IClosable, IStringable, IHttpContent
/// [Windows.Foundation.Metadata.Activatable(Windows.Web.Http.IHttpFormUrlEncodedContentFactory, 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 HttpFormUrlEncodedContent final : 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(Windows.Web.Http.IHttpFormUrlEncodedContentFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class HttpFormUrlEncodedContent final : IClosable, IStringable, IHttpContent
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Web.Http.IHttpFormUrlEncodedContentFactory), 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 HttpFormUrlEncodedContent : 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(typeof(Windows.Web.Http.IHttpFormUrlEncodedContentFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class HttpFormUrlEncodedContent : System.IDisposable, IStringable, IHttpContent
function HttpFormUrlEncodedContent(content)
Public NotInheritable Class HttpFormUrlEncodedContent
Implements IDisposable, IHttpContent, IStringable
继承
Object Platform::Object IInspectable HttpFormUrlEncodedContent
属性
实现

Windows 要求

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

构造函数

HttpFormUrlEncodedContent(IIterable<KeyValuePair<String,String>>)

使用指定内容初始化 HttpFormUrlEncodedContent 类的新实例。

属性

Headers

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

方法

BufferAllAsync()

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

Close()

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

Dispose()

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

ReadAsBufferAsync()

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

ReadAsInputStreamAsync()

序列化 HttpFormUrlEncodedContent 并返回将内容表示为异步操作的输入流。

ReadAsStringAsync()

HttpFormUrlEncodedContent 作为异步操作序列化为 字符串

ToString()

返回表示当前 HttpFormUrlEncodedContent 对象的字符串。

TryComputeLength(UInt64)

计算 HttpFormUrlEncodedContent 长度(以字节为单位)。

WriteToStreamAsync(IOutputStream)

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

适用于

另请参阅