Partager via


HttpMethodConstraint.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
Protected Overridable Function Match ( _
    request As HttpRequestMessage, _
    route As IHttpRoute, _
    parameterName As String, _
    values As IDictionary(Of String, Object), _
    routeDirection As HttpRouteDirection _
) As Boolean
'Usage
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 = Me.Match(request, route, _
    parameterName, values, routeDirection)
protected virtual bool Match(
    HttpRequestMessage request,
    IHttpRoute route,
    string parameterName,
    IDictionary<string, Object> values,
    HttpRouteDirection routeDirection
)
protected:
virtual bool Match(
    HttpRequestMessage^ request, 
    IHttpRoute^ route, 
    String^ parameterName, 
    IDictionary<String^, Object^>^ values, 
    HttpRouteDirection routeDirection
)
abstract Match : 
        request:HttpRequestMessage * 
        route:IHttpRoute * 
        parameterName:string * 
        values:IDictionary<string, Object> * 
        routeDirection:HttpRouteDirection -> bool 
override Match : 
        request:HttpRequestMessage * 
        route:IHttpRoute * 
        parameterName:string * 
        values:IDictionary<string, Object> * 
        routeDirection:HttpRouteDirection -> bool 
protected function Match(
    request : HttpRequestMessage, 
    route : IHttpRoute, 
    parameterName : String, 
    values : IDictionary<String, Object>, 
    routeDirection : HttpRouteDirection
) : boolean

Parameters

  • request
    Type: HttpRequestMessage
    The request that is being checked to determine whether it matches the URL.
  • parameterName
    Type: System.String
    The name of the parameter that is being checked.

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.

See Also

Reference

HttpMethodConstraint Class

System.Web.Http.Routing Namespace