共用方式為


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 引進)

備註

傳送 (POST 方法) HttpBufferContent 類別時, 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()

執行與釋放 (Free)、釋放 (Release) 或重設 Unmanaged 資源相關聯之應用程式定義的工作。

ReadAsBufferAsync()

HttpBufferContent 序列化為非同步作業的緩衝區。

ReadAsInputStreamAsync()

序列化 HttpBufferContent ,並傳回輸入資料流程,代表內容做為非同步作業。

ReadAsStringAsync()

HttpBufferContent 序列化為 字串 作為非同步作業。

ToString()

會傳回代表目前 HttpBufferContent 物件的字串。

TryComputeLength(UInt64)

以位元組為單位計算 HttpBufferContent 長度。

WriteToStreamAsync(IOutputStream)

HttpBufferContent 寫入輸出資料流程作為非同步作業。

適用於

另請參閱