HttpMethodConstraint.Match(HttpContextBase, Route, String, RouteValueDictionary, RouteDirection) HttpMethodConstraint.Match(HttpContextBase, Route, String, RouteValueDictionary, RouteDirection) HttpMethodConstraint.Match(HttpContextBase, Route, String, RouteValueDictionary, RouteDirection) Method

Definition

Determines whether the request was made with an HTTP verb that is one of the allowed verbs for the route.

protected:
 virtual bool Match(System::Web::HttpContextBase ^ httpContext, System::Web::Routing::Route ^ route, System::String ^ parameterName, System::Web::Routing::RouteValueDictionary ^ values, System::Web::Routing::RouteDirection routeDirection);
protected virtual bool Match (System.Web.HttpContextBase httpContext, System.Web.Routing.Route route, string parameterName, System.Web.Routing.RouteValueDictionary values, System.Web.Routing.RouteDirection routeDirection);
abstract member Match : System.Web.HttpContextBase * System.Web.Routing.Route * string * System.Web.Routing.RouteValueDictionary * System.Web.Routing.RouteDirection -> bool
override this.Match : System.Web.HttpContextBase * System.Web.Routing.Route * string * System.Web.Routing.RouteValueDictionary * System.Web.Routing.RouteDirection -> bool

Parameters

httpContext
HttpContextBase HttpContextBase HttpContextBase

An object that encapsulates information about the HTTP request.

route
Route Route Route

The object that is being checked to determine whether it matches the URL.

parameterName
String String String

The name of the parameter that is being checked.

values
RouteValueDictionary RouteValueDictionary RouteValueDictionary

An object that contains the parameters for a route.

routeDirection
RouteDirection RouteDirection RouteDirection

An object that indicates whether the constraint check is being performed when an incoming request is processed or when a URL is generated.

Returns

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.

Implements

Exceptions

One or more of the following parameters is null: httpContext, route, parameterName, or values.

Applies to

See also