HttpMethod 类

定义

检索标准 HTTP 方法(如 GET 和 POST)并创建新的 HTTP 方法。

public ref class HttpMethod sealed : IStringable
/// [Windows.Foundation.Metadata.Activatable(Windows.Web.Http.IHttpMethodFactory, 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 HttpMethod final : IStringable
/// [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.IHttpMethodFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class HttpMethod final : IStringable
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Web.Http.IHttpMethodFactory), 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 HttpMethod : IStringable
[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.IHttpMethodFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class HttpMethod : IStringable
function HttpMethod(method)
Public NotInheritable Class HttpMethod
Implements IStringable
继承
Object Platform::Object IInspectable HttpMethod
属性
实现

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

注解

HttpMethod 的最常见用途是从此类的属性 (谓词) 获取标准 HTTP 方法。 但是,如果应用需要 HTTP 方法的不同值, HttpMethod 构造函数会使用应用开发人员指定的 HTTP 方法初始化 HttpMethod 的新实例。

构造函数

HttpMethod(String)

使用特定的 HTTP 方法初始化 HttpMethod 类的新实例。

属性

Delete

获取 HTTP DELETE 方法。

Get

获取 HTTP GET 方法。

Head

获取 HTTP HEAD 方法。

Method

获取 HTTP 方法。

Options

获取 HTTP OPTIONS 方法。

Patch

获取 HTTP PATCH 方法,

Post

获取 HTTP POST 方法。

Put

获取 HTTP PUT 方法。

方法

ToString()

返回一个表示当前 HttpMethod 对象的字符串。

适用于

另请参阅