HttpMethod HttpMethod HttpMethod HttpMethod Class

定義

協助程式類別,用於擷取和比較標準 HTTP 方法,以及建立新的 HTTP 方法。A helper class for retrieving and comparing standard HTTP methods and for creating new HTTP methods.

public ref class HttpMethod : IEquatable<System::Net::Http::HttpMethod ^>
public class HttpMethod : IEquatable<System.Net.Http.HttpMethod>
type HttpMethod = class
    interface IEquatable<HttpMethod>
Public Class HttpMethod
Implements IEquatable(Of HttpMethod)
繼承
HttpMethodHttpMethodHttpMethodHttpMethod
實作

備註

最常見的用法HttpMethod是使用此類別上的其中一個靜態屬性。The most common usage of HttpMethod is to use one of the static properties on this class. 不過, 如果應用程式需要不同的 HTTP 方法值, 則此HttpMethod函式會使用應用程式指定的 HTTP 方法, 初始化的HttpMethod新實例。However, if an app needs a different value for the HTTP method, the HttpMethod constructor initializes a new instance of the HttpMethod with an HTTP method that the app specifies.

建構函式

HttpMethod(String) HttpMethod(String) HttpMethod(String) HttpMethod(String)

使用特定 HTTP 方法,初始化 HttpMethod 類別的新執行個體。Initializes a new instance of the HttpMethod class with a specific HTTP method.

屬性

Delete Delete Delete Delete

表示 HTTP DELETE 通訊協定方法。Represents an HTTP DELETE protocol method.

Get Get Get Get

表示 HTTP GET 通訊協定方法。Represents an HTTP GET protocol method.

Head Head Head Head

表示 HTTP HEAD 通訊協定方法。Represents an HTTP HEAD protocol method. HEAD 方法與 GET 相同,除了伺服器只在回應中傳回訊息標頭,不含訊息主體。The HEAD method is identical to GET except that the server only returns message-headers in the response, without a message-body.

Method Method Method Method

HTTP 方法。An HTTP method.

Options Options Options Options

表示 HTTP OPTIONS 通訊協定方法。Represents an HTTP OPTIONS protocol method.

Patch Patch Patch Patch
Post Post Post Post

表示 HTTP POST 通訊協定方法,用來公佈新實體至 URI 做為新增項目。Represents an HTTP POST protocol method that is used to post a new entity as an addition to a URI.

Put Put Put Put

表示 HTTP PUT 通訊協定方法,用來取代 URI 所識別的實體。Represents an HTTP PUT protocol method that is used to replace an entity identified by a URI.

Trace Trace Trace Trace

表示 HTTP TRACE 通訊協定方法。Represents an HTTP TRACE protocol method.

方法

Equals(HttpMethod) Equals(HttpMethod) Equals(HttpMethod) Equals(HttpMethod)

判斷指定的 HttpMethod 是否等於目前的 ObjectDetermines whether the specified HttpMethod is equal to the current Object.

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

判斷指定的 Object 是否等於目前的 ObjectDetermines whether the specified Object is equal to the current Object.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作為此類型的雜湊函式。Serves as a hash function for this type.

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.

運算子

Equality(HttpMethod, HttpMethod) Equality(HttpMethod, HttpMethod) Equality(HttpMethod, HttpMethod) Equality(HttpMethod, HttpMethod)

用來比較兩個 HttpMethod 物件的等號比較運算子。The equality operator for comparing two HttpMethod objects.

Inequality(HttpMethod, HttpMethod) Inequality(HttpMethod, HttpMethod) Inequality(HttpMethod, HttpMethod) Inequality(HttpMethod, HttpMethod)

用來比較兩個 HttpMethod 物件的不等比較運算子。The inequality operator for comparing two HttpMethod objects.

適用於