Share via


HttpMethodConstraint.Match Method (HttpRequestMessage, IHttpRoute, String, IDictionary<String, Object>, HttpRouteDirection)

 

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

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 Overridable Function Match (
    request As HttpRequestMessage,
    route As IHttpRoute,
    parameterName As String,
    values As IDictionary(Of String, Object),
    routeDirection As HttpRouteDirection
) As Boolean

Parameters

  • 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

HttpMethodConstraint Class
System.Web.Http.Routing Namespace

Return to top