3

What exactly is the difference between

    [System.Web.Http.AcceptVerbs("GET")]
    public string[] SomeArray(string someString)
    {

and

    [System.Web.Http.HttpGet]
    public string[] SomeArray(string someString)
    {

and when would one use which of them, and when would one use both? I already found many examples using

    [System.Web.Http.AcceptVerbs("GET")]
    [System.Web.Http.HttpGet]
    public string[] SomeArray(string someString)
    {
Alexander
  • 19,906
  • 19
  • 75
  • 162

1 Answers1

3

Both of them are same. HttpPost/HttpGet attributes are a shortcut for the HttpVerbs.Post/HttpVerbs.Get since MVC 2.0.

See this :

  1. What is the difference between [AcceptVerbs(HttpVerbs.Post)] and [HttpPost]?
  2. asp.net mvc - [HttpPost/HttpGet] vs. [AcceptVerbs(HttpVerbs.Post/Get)]
Community
  • 1
  • 1
Iswanto San
  • 18,263
  • 13
  • 58
  • 79