HttpRequestMessage HttpRequestMessage HttpRequestMessage HttpRequestMessage Class

定義

代表 HTTP 要求訊息。Represents a HTTP request message.

public ref class HttpRequestMessage : IDisposable
public class HttpRequestMessage : IDisposable
type HttpRequestMessage = class
    interface IDisposable
Public Class HttpRequestMessage
Implements IDisposable
繼承
HttpRequestMessageHttpRequestMessageHttpRequestMessageHttpRequestMessage
實作

備註

HttpRequestMessage類別包含標頭、 HTTP 指令動詞,以及可能資料。The HttpRequestMessage class contains headers, the HTTP verb, and potentially data.

建構函式

HttpRequestMessage() HttpRequestMessage() HttpRequestMessage() HttpRequestMessage()

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

HttpRequestMessage(HttpMethod, String) HttpRequestMessage(HttpMethod, String) HttpRequestMessage(HttpMethod, String) HttpRequestMessage(HttpMethod, String)

使用 HTTP 方法和要求 HttpRequestMessage,初始化 Uri 類別的新執行個體。Initializes a new instance of the HttpRequestMessage class with an HTTP method and a request Uri.

HttpRequestMessage(HttpMethod, Uri) HttpRequestMessage(HttpMethod, Uri) HttpRequestMessage(HttpMethod, Uri) HttpRequestMessage(HttpMethod, Uri)

使用 HTTP 方法和要求 HttpRequestMessage,初始化 Uri 類別的新執行個體。Initializes a new instance of the HttpRequestMessage class with an HTTP method and a request Uri.

屬性

Content Content Content Content

取得或設定 HTTP 訊息內容。Gets or sets the contents of the HTTP message.

Headers Headers Headers Headers

取得 HTTP 要求標頭的集合。Gets the collection of HTTP request headers.

Method Method Method Method

取得或設定 HTTP 要求訊息使用的 HTTP 方法。Gets or sets the HTTP method used by the HTTP request message.

Properties Properties Properties Properties

取得 HTTP 要求的屬性集。Gets a set of properties for the HTTP request.

RequestUri RequestUri RequestUri RequestUri

取得或設定使用於 HTTP 要求的 UriGets or sets the Uri used for the HTTP request.

Version Version Version Version

取得或設定 HTTP 訊息版本。Gets or sets the HTTP message version.

方法

Dispose() Dispose() Dispose() Dispose()

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

Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

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

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

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

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

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

Extension Methods

GetUserPrincipal(HttpRequestMessage) GetUserPrincipal(HttpRequestMessage) GetUserPrincipal(HttpRequestMessage) GetUserPrincipal(HttpRequestMessage)

取得與指定之 HTTP 要求訊息相關聯的使用者主體。Gets the user principal associated with the specified HTTP request message.

SetUserPrincipal(HttpRequestMessage, IPrincipal) SetUserPrincipal(HttpRequestMessage, IPrincipal) SetUserPrincipal(HttpRequestMessage, IPrincipal) SetUserPrincipal(HttpRequestMessage, IPrincipal)

取代與指定之 HTTP 要求訊息相關聯的使用者主體。Replaces the user principal associated with the specified HTTP request message.

ToMessage(HttpRequestMessage) ToMessage(HttpRequestMessage) ToMessage(HttpRequestMessage) ToMessage(HttpRequestMessage)

Message 執行個體建立 HttpRequestMessage 執行個體。Creates a Message instance from an HttpRequestMessage instance.

適用於