Table of Contents

Class AcceptVerbsAttribute

Namespace
System.Web.Http
Assembly
System.Web.Http.dll

Represents an attribute that specifies which HTTP methods an action method will respond to.

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public sealed class AcceptVerbsAttribute : Attribute, IActionHttpMethodProvider
Inheritance
AcceptVerbsAttribute
Implements
Inherited Members

Constructors

AcceptVerbsAttribute(string)

Initializes a new instance of the AcceptVerbsAttribute class by using the action method it will respond to.

public AcceptVerbsAttribute(string method)

Parameters

method string

The HTTP method that the action method will respond to.

AcceptVerbsAttribute(params string[])

Initializes a new instance of the AcceptVerbsAttribute class by using a list of HTTP methods that the action method will respond to.

public AcceptVerbsAttribute(params string[] methods)

Parameters

methods string[]

The HTTP methods that the action method will respond to.

Properties

HttpMethods

Gets or sets the list of HTTP methods that the action method will respond to.

public Collection<HttpMethod> HttpMethods { get; }

Property Value

Collection<HttpMethod>

Gets or sets the list of HTTP methods that the action method will respond to.