HttpStreamContent 类

定义

提供使用流的 HTTP 内容。

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

Windows 要求

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

构造函数

HttpStreamContent(IInputStream)

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

属性

Headers

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

方法

BufferAllAsync()

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

Close()

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

Dispose()

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

ReadAsBufferAsync()

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

ReadAsInputStreamAsync()

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

ReadAsStringAsync()

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

ToString()

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

TryComputeLength(UInt64)

确定 HttpStreamContent 是否具有有效的长度(以字节为单位)。

WriteToStreamAsync(IOutputStream)

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

适用于

另请参阅