Table of Contents

Class HttpMethod

Namespace
System.Net.Http
Assembly
System.Net.Http.dll

A helper class for retrieving and comparing standard HTTP methods and for creating new HTTP methods.

public class HttpMethod
Inheritance
HttpMethod
Inherited Members
Extension Methods

Remarks

The most common usage of HttpMethod is to use one of the static properties on this class. 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.

Constructors

HttpMethod(string)

Initializes a new instance of the HttpMethod class with a specific HTTP method.

public HttpMethod(string method)

Parameters

method string

The HTTP method.

Remarks

If an app needs a different value for the HTTP method from one of the static properties, the HttpMethod constructor initializes a new instance of the HttpMethod with an HTTP method that the app specifies.

Exceptions

ArgumentException

Properties

Delete

Represents an HTTP DELETE protocol method.

public static HttpMethod Delete { get; }

Property Value

HttpMethod

Get

Represents an HTTP GET protocol method.

public static HttpMethod Get { get; }

Property Value

HttpMethod

Head

Represents an HTTP HEAD protocol method.

public static HttpMethod Head { get; }

Property Value

HttpMethod

Method

An HTTP method.

public string Method { get; }

Property Value

string

An HTTP method represented as a string.

Options

Represents an HTTP OPTIONS protocol method.

public static HttpMethod Options { get; }

Property Value

HttpMethod

Patch

Represents an HTTP PATCH protocol method.

public static HttpMethod Patch { get; }

Property Value

HttpMethod

Post

Represents an HTTP POST protocol method.

public static HttpMethod Post { get; }

Property Value

HttpMethod

Put

Represents an HTTP PUT protocol method.

public static HttpMethod Put { get; }

Property Value

HttpMethod