Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class Microsoft.​AspNetCore.​Http.​HttpMethods
Assembly: Microsoft.AspNetCore.Http.Abstractions
Inheritance: object → HttpMethods
Contains methods to verify the request method of an HTTP request.
Fields and Constants
public static readonly
string
Connect
HTTP "CONNECT" method.
public static readonly
string
Delete
HTTP "DELETE" method.
public static readonly
string
Get
HTTP "GET" method.
public static readonly
string
Head
HTTP "HEAD" method.
public static readonly
string
Options
HTTP "OPTIONS" method.
public static readonly
string
Patch
HTTP "PATCH" method.
public static readonly
string
Post
HTTP "POST" method.
public static readonly
string
Put
HTTP "PUT" method.
public static readonly
string
Query
HTTP "QUERY" method.
public static readonly
string
Trace
HTTP "TRACE" method.
Methods
public static
bool
IsConnect​(string method)
Returns a value that indicates if the HTTP request method is CONNECT.
Returns <see langword="true" /> if the method is CONNECT; otherwise, <see langword="false" /> .
method
The HTTP request method.
public static
bool
IsDelete​(string method)
Returns a value that indicates if the HTTP request method is DELETE.
Returns <see langword="true" /> if the method is DELETE; otherwise, <see langword="false" /> .
method
The HTTP request method.
public static
bool
IsGet​(string method)
Returns a value that indicates if the HTTP request method is GET.
Returns <see langword="true" /> if the method is GET; otherwise, <see langword="false" /> .
method
The HTTP request method.
public static
bool
IsHead​(string method)
Returns a value that indicates if the HTTP request method is HEAD.
Returns <see langword="true" /> if the method is HEAD; otherwise, <see langword="false" /> .
method
The HTTP request method.
public static
bool
IsOptions​(string method)
Returns a value that indicates if the HTTP request method is OPTIONS.
Returns <see langword="true" /> if the method is OPTIONS; otherwise, <see langword="false" /> .
method
The HTTP request method.
public static
bool
IsPatch​(string method)
Returns a value that indicates if the HTTP request method is PATCH.
Returns <see langword="true" /> if the method is PATCH; otherwise, <see langword="false" /> .
method
The HTTP request method.
public static
bool
IsPost​(string method)
Returns a value that indicates if the HTTP request method is POST.
Returns <see langword="true" /> if the method is POST; otherwise, <see langword="false" /> .
method
The HTTP request method.
public static
bool
IsPut​(string method)
Returns a value that indicates if the HTTP request method is PUT.
Returns <see langword="true" /> if the method is PUT; otherwise, <see langword="false" /> .
method
The HTTP request method.
public static
bool
IsQuery​(string method)
Returns a value that indicates if the HTTP request method is QUERY.
Returns <see langword="true" /> if the method is QUERY; otherwise, <see langword="false" /> .
method
The HTTP request method.
public static
bool
IsTrace​(string method)
Returns a value that indicates if the HTTP request method is TRACE.
Returns <see langword="true" /> if the method is TRACE; otherwise, <see langword="false" /> .
method
The HTTP request method.
public static
string
GetCanonicalizedValue​(string method)
Returns the equivalent static instance, or the original instance if none match. This conversion is optional but allows for performance optimizations when comparing method values elsewhere.
public static
bool
Equals​(string methodA,
string methodB)
Returns a value that indicates if the HTTP methods are the same.
Returns <see langword="true" /> if the methods are the same; otherwise, <see langword="false" /> .
methodA
The first HTTP request method to compare.
methodB
The second HTTP request method to compare.
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object