Class HttpMethodExtensions

HttpMethod helpers.

Inheritance
object
HttpMethodExtensions
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: NanoRoute
Assembly: NanoRoute.dll
Syntax
public static class HttpMethodExtensions
Examples
HttpMethod method = HttpMethod.For("PATCH");

Methods

For(string)

Returns the shared HttpMethod instance for a known method name, or creates one for a custom method.

Declaration
public static HttpMethod For(string method)
Parameters
Type Name Description
string method

The HTTP method name.

Returns
Type Description
HttpMethod

The matching HttpMethod.

Examples
HttpMethod method = HttpMethod.For("GET");
Exceptions
Type Condition
ArgumentNullException

Thrown when method is null.

ArgumentException

Thrown when method is empty or whitespace.

FormatException

Thrown when method is not a valid HTTP method token.

In this article
Back to top Generated by DocFX