HttpBufferContent 类

定义

提供使用缓冲区的 HTTP 内容。

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

Windows 要求

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

注解

) HttpBufferContent 类发送 (POST 方法时, HttpProgress.BytesSent 值从发送的 0% 字节跃至在一个进度事件中发送的 100% 字节,因为整个缓冲区一次移动到较低的网络 API。 有关更详细的进度,请使用 HttpStreamContent 而不是 HttpBufferContent,因为流是以较小的区块读取和发送的,从而产生更多的进度事件。 例如发送了 0 个字节、发送了 65536 个字节、131072个发送的字节等。

构造函数

HttpBufferContent(IBuffer)

使用指定的缓冲区初始化 HttpBufferContent 类的新实例。

HttpBufferContent(IBuffer, UInt32, UInt32)

使用来自指定缓冲区的偏移量和字节计数初始化 HttpBufferContent 类的新实例。

属性

Headers

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

方法

BufferAllAsync()

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

Close()

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

Dispose()

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

ReadAsBufferAsync()

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

ReadAsInputStreamAsync()

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

ReadAsStringAsync()

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

ToString()

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

TryComputeLength(UInt64)

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

WriteToStreamAsync(IOutputStream)

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

适用于

另请参阅