HttpMethodConstraint Class

 

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

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

Inheritance Hierarchy

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

Syntax

public class HttpMethodConstraint : IHttpRouteConstraint
public ref class HttpMethodConstraint : IHttpRouteConstraint
type HttpMethodConstraint = 
    class
        interface IHttpRouteConstraint
    end
Public Class HttpMethodConstraint
    Implements IHttpRouteConstraint

Constructors

Name Description
System_CAPS_pubmethod HttpMethodConstraint(HttpMethod[])

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

Properties

Name Description
System_CAPS_pubproperty AllowedMethods

Gets or sets the collection of allowed HTTP verbs for the route.

Methods

Name Description
System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_protmethod Finalize()

(Inherited from Object.)

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_protmethod Match(HttpRequestMessage, IHttpRoute, String, IDictionary<String, Object>, HttpRouteDirection)

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

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethod ToString()

(Inherited from Object.)

Explicit Interface Implementations

Name Description
System_CAPS_pubinterfaceSystem_CAPS_privmethod IHttpRouteConstraint.Match(HttpRequestMessage, IHttpRoute, String, IDictionary<String, Object>, HttpRouteDirection)

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

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

System.Web.Http.Routing Namespace

Return to top