共用方式為


HttpStringContent 類別

定義

提供使用字串的 HTTP 內容。

public ref class HttpStringContent sealed : IClosable, IStringable, IHttpContent
/// [Windows.Foundation.Metadata.Activatable(Windows.Web.Http.IHttpStringContentFactory, 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 HttpStringContent 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.IHttpStringContentFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class HttpStringContent final : IClosable, IStringable, IHttpContent
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Web.Http.IHttpStringContentFactory), 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 HttpStringContent : 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.IHttpStringContentFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class HttpStringContent : System.IDisposable, IStringable, IHttpContent
function HttpStringContent(content, encoding, mediaType)
Public NotInheritable Class HttpStringContent
Implements IDisposable, IHttpContent, IStringable
繼承
Object Platform::Object IInspectable HttpStringContent
屬性
實作

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

建構函式

HttpStringContent(String)

使用指定的內容,初始化 HttpStringContent 類別的新實例。

HttpStringContent(String, UnicodeEncoding)

使用指定的內容和編碼,初始化 HttpStringContent 類別的新實例。

HttpStringContent(String, UnicodeEncoding, String)

使用指定的內容、編碼和媒體類型,初始化 HttpStringContent 類別的新實例。

屬性

Headers

取得在 HttpStringContent上設定的內容標頭集合。

方法

BufferAllAsync()

HttpStringContent 序列化為記憶體作為非同步作業。

Close()

關閉 HttpStringContent 實例,並釋放已配置的資源。

Dispose()

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

ReadAsBufferAsync()

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

ReadAsInputStreamAsync()

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

ReadAsStringAsync()

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

ToString()

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

TryComputeLength(UInt64)

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

WriteToStreamAsync(IOutputStream)

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

適用於

另請參閱