Share via


HttpMethodConstraint Class

Enables you to define which HTTP verbs are allowed when ASP.NET routing determines whether a URL matches a route.

Inheritance Hierarchy

System.Object
  System.Web.Http.Routing.HttpMethodConstraint

Namespace:  System.Web.Http.Routing
Assembly:  System.Web.Http (in System.Web.Http.dll)

Syntax

'Declaration
Public Class HttpMethodConstraint _
    Implements IHttpRouteConstraint
'Usage
Dim instance As HttpMethodConstraint
public class HttpMethodConstraint : IHttpRouteConstraint
public ref class HttpMethodConstraint : IHttpRouteConstraint
type HttpMethodConstraint =  
    class
        interface IHttpRouteConstraint
    end
public class HttpMethodConstraint implements IHttpRouteConstraint

The HttpMethodConstraint type exposes the following members.

Constructors

  Name Description
Public method HttpMethodConstraint Initializes a new instance of the HttpMethodConstraint class by using the HTTP verbs that are allowed for the route.

Top

Properties

  Name Description
Public property AllowedMethods Gets or sets the collection of allowed HTTP verbs for the route.

Top

Methods

  Name Description
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Protected method Match Determines whether the request was made with an HTTP verb that is one of the allowed verbs for the route.
Protected method MemberwiseClone (Inherited from Object.)
Public method ToString (Inherited from Object.)

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method IHttpRouteConstraint.Match Determines whether the request was made with an HTTP verb that is one of the allowed verbs for the route.

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

System.Web.Http.Routing Namespace