HttpMethodConstraint.IHttpRouteConstraint.Match Method
Determines whether the request was made with an HTTP verb that is one of the allowed verbs for the route.
Namespace: System.Web.Http.Routing
Assembly: System.Web.Http (in System.Web.Http.dll)
Syntax
'Declaration
Private Function Match ( _
request As HttpRequestMessage, _
route As IHttpRoute, _
parameterName As String, _
values As IDictionary(Of String, Object), _
routeDirection As HttpRouteDirection _
) As Boolean Implements IHttpRouteConstraint.Match
'Usage
Dim instance As HttpMethodConstraint
Dim request As HttpRequestMessage
Dim route As IHttpRoute
Dim parameterName As String
Dim values As IDictionary(Of String, Object)
Dim routeDirection As HttpRouteDirection
Dim returnValue As Boolean
returnValue = CType(instance, IHttpRouteConstraint).Match(request, _
route, parameterName, values, routeDirection)
bool IHttpRouteConstraint.Match(
HttpRequestMessage request,
IHttpRoute route,
string parameterName,
IDictionary<string, Object> values,
HttpRouteDirection routeDirection
)
private:
virtual bool Match(
HttpRequestMessage^ request,
IHttpRoute^ route,
String^ parameterName,
IDictionary<String^, Object^>^ values,
HttpRouteDirection routeDirection
) sealed = IHttpRouteConstraint::Match
private abstract Match :
request:HttpRequestMessage *
route:IHttpRoute *
parameterName:string *
values:IDictionary<string, Object> *
routeDirection:HttpRouteDirection -> bool
private override Match :
request:HttpRequestMessage *
route:IHttpRoute *
parameterName:string *
values:IDictionary<string, Object> *
routeDirection:HttpRouteDirection -> bool
JScript supports the use of explicit interface implementations, but not the declarations of new ones.
Parameters
- request
Type: HttpRequestMessage
The request that is being checked to determine whether it matches the URL.
- route
Type: System.Web.Http.Routing.IHttpRoute
The object that is being checked to determine whether it matches the URL.
- parameterName
Type: System.String
The name of the parameter that is being checked.
- values
Type: System.Collections.Generic.IDictionary<String, Object>
An object that contains the parameters for a route.
- routeDirection
Type: System.Web.Http.Routing.HttpRouteDirection
An object that indicates whether the constraint check is being performed when an incoming request is processed or when a URL is generated.
Return Value
Type: System.Boolean
When ASP.NET routing is processing a request, true if the request was made by using an allowed HTTP verb; otherwise, false. When ASP.NET routing is constructing a URL, true if the supplied values contain an HTTP verb that matches one of the allowed HTTP verbs; otherwise, false. The default is true.