HttpMethodConstraint.Match Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Protected Overridable Function Match (httpContext As HttpContextBase, route As Route, parameterName As String, values As RouteValueDictionary, routeDirection As RouteDirection) As Boolean
Parameters
- httpContext
- HttpContextBase
An object that encapsulates information about the HTTP request.
- route
- Route
The object that is being checked to determine whether it matches the URL.
- parameterName
- String
The name of the parameter that is being checked.
- values
- RouteValueDictionary
An object that contains the parameters for a route.
- 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
.
Exceptions
One or more of the following parameters is null
: httpContext
, route
, parameterName
, or values
.