Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

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.Routing
Assembly:  System.Web (in System.Web.dll)

protected virtual bool Match(
	HttpContextBase httpContext,
	Route route,
	string parameterName,
	RouteValueDictionary values,
	RouteDirection routeDirection
)

Parameters

httpContext
Type: System.Web.HttpContextBase

An object that encapsulates information about the HTTP request.

route
Type: System.Web.Routing.Route

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.Web.Routing.RouteValueDictionary

An object that contains the parameters for a route.

routeDirection
Type: System.Web.Routing.RouteDirection

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.

ExceptionCondition
ArgumentNullException

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5 SP1
Show:
© 2015 Microsoft