HttpContent 類別

定義

代表 HTTP 實體內容和內容標頭的基底類別。A base class representing an HTTP entity body and content headers.

public ref class HttpContent abstract : IDisposable
public abstract class HttpContent : IDisposable
type HttpContent = class
    interface IDisposable
Public MustInherit Class HttpContent
Implements IDisposable
繼承
HttpContent
衍生
實作

建構函式

HttpContent()

初始化 HttpContent 類別的新執行個體。Initializes a new instance of the HttpContent class.

屬性

Headers

取得 HTTP 內容標頭,如 RFC 2616 中所定義。Gets the HTTP content headers as defined in RFC 2616.

方法

CopyToAsync(Stream)

將 HTTP 內容序列化成位元組資料流,然後複製到 stream 參數所提供的資料流物件。Serialize the HTTP content into a stream of bytes and copies it to the stream object provided as the stream parameter.

CopyToAsync(Stream, TransportContext)

將 HTTP 內容序列化成位元組資料流,然後複製到 stream 參數所提供的資料流物件。Serialize the HTTP content into a stream of bytes and copies it to the stream object provided as the stream parameter.

CreateContentReadStreamAsync()

以非同步作業方式將 HTTP 內容序列化為記憶體資料流。Serialize the HTTP content to a memory stream as an asynchronous operation.

Dispose()

釋放 Unmanaged 資源,並處置 HttpContent 所使用的 Managed 資源。Releases the unmanaged resources and disposes of the managed resources used by the HttpContent.

Dispose(Boolean)

釋放 HttpContent 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。Releases the unmanaged resources used by the HttpContent and optionally disposes of the managed resources.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

作為預設雜湊函數。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
LoadIntoBufferAsync()

以非同步作業方式將 HTTP 內容序列化至記憶體緩衝區。Serialize the HTTP content to a memory buffer as an asynchronous operation.

LoadIntoBufferAsync(Int64)

以非同步作業方式將 HTTP 內容序列化至記憶體緩衝區。Serialize the HTTP content to a memory buffer as an asynchronous operation.

MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
ReadAsByteArrayAsync()

以非同步作業方式將位元組陣列的 HTTP 內容序列化。Serialize the HTTP content to a byte array as an asynchronous operation.

ReadAsStreamAsync()

以非同步作業方式將 HTTP 內容序列化,並傳回代表內容的資料流。Serialize the HTTP content and return a stream that represents the content as an asynchronous operation.

ReadAsStringAsync()

以非同步作業方式將 HTTP 內容序列化為字串。Serialize the HTTP content to a string as an asynchronous operation.

SerializeToStreamAsync(Stream, TransportContext)

以非同步作業方式將 HTTP 內容序列化為資料流。Serialize the HTTP content to a stream as an asynchronous operation.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)
TryComputeLength(Int64)

判斷 HTTP 內容是否有有效的位元組長度。Determines whether the HTTP content has a valid length in bytes.

適用於