Enables you to define which HTTP verbs are allowed when ASP.NET routing determines whether a URL matches a route.
Assembly: System.Web (in System.Web.dll)
Initializes a new instance of theclass by using the HTTP verbs that are allowed for the route.
Determines whether the specified object is equal to the current object.(Inherited from Object.)
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)
Serves as the default hash function. (Inherited from Object.)
|Match(HttpContextBase, Route, String, RouteValueDictionary, RouteDirection)|
Determines whether the request was made with an HTTP verb that is one of the allowed verbs for the route.
Returns a string that represents the current object.(Inherited from Object.)
|IRouteConstraint.Match(HttpContextBase, Route, String, RouteValueDictionary, RouteDirection)|
For a description of this member, see Match.
Theclass enables you to limit route matching to certain HTTP verbs. For example, you can specify that a route is considered a match for a URL only when the HTTP verb for the request is POST.
To set constraints for route matching, you set the Constraints property of the Route class to an instance of the RouteValueDictionary class. To set an HTTP verb constraint, you set the value of one dictionary element to an object and the key to any name.
In the HttpMethodConstraint method, you include all the HTTP verbs that are allowed for the route when ASP.NET routing determines whether the route matches a URL.
Available since 3.5
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.