AcceptVerbsAttribute Class

Summary

Specifies what HTTP methods an action supports.

Syntax

public sealed class AcceptVerbsAttribute : Attribute, _Attribute, IActionHttpMethodProvider, IRouteTemplateProvider

GitHub

View on GitHub

class Microsoft.AspNet.Mvc.AcceptVerbsAttribute

Constructors

AcceptVerbsAttribute(System.String)

Initializes a new instance of the [Microsoft.AspNet.Mvc.AcceptVerbsAttribute](Microsoft.AspNet.Mvc.AcceptVerbsAttribute.yml) class.

Arguments:
  • method (System.String) – The HTTP method the action supports.
public AcceptVerbsAttribute(string method)
AcceptVerbsAttribute(System.String[])

Initializes a new instance of the [Microsoft.AspNet.Mvc.AcceptVerbsAttribute](Microsoft.AspNet.Mvc.AcceptVerbsAttribute.yml) class.

Arguments:
  • methods (System.String[]) – The HTTP methods the action supports.
public AcceptVerbsAttribute(params string[] methods)

Properties

HttpMethods()

Gets the HTTP methods the action supports.

Return type:System.Collections.Generic.IEnumerable{System.String}
public IEnumerable<string> HttpMethods { get; }
Order()
Return type:System.Nullable{System.Int32}
int ? IRouteTemplateProvider.Order { get; }
Template()
Return type:System.String
string IRouteTemplateProvider.Template { get; }
Name()
Return type:System.String
public string Name { get; set; }
Order()

Gets the route order. The order determines the order of route execution. Routes with a lower order value are tried first. When a route doesn’t specify a value, it gets the value of the [Microsoft.AspNet.Mvc.RouteAttribute.Order](Microsoft.AspNet.Mvc.RouteAttribute.yml) or a default value of 0 if the [Microsoft.AspNet.Mvc.RouteAttribute](Microsoft.AspNet.Mvc.RouteAttribute.yml) doesn’t define a value on the controller.

Return type:System.Int32
public int Order { get; set; }
Route()

The route template. May be null.

Return type:System.String
public string Route { get; set; }