Class HttpMethodExtensions
HttpMethod helpers.
Inherited Members
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 |
| ArgumentException | Thrown when |
| FormatException | Thrown when |