In ASP.NET, MVC controllers can be decorated for reception by certain HTTP methods (Get, Post, Get .., etc.). There are 3 classes between MvcContrib and ASP.NET MVC: "AcceptGet, AcceptPost" and AcceptVerbs. All three: "AcceptGet, AcceptPost" and AcceptVerbs do the same. They indicate which http method is allowed to access the action / method.
AcceptGet and AcceptPost are in MvcContrib. Although AcceptVerbs is native to the Mvc framework. Which is better to use?
AcceptGet / AcceptPost (MvcContrib)
AcceptVerbs (ASP.NET Mvc)
The documentation for the MvcContrib AcceptPost project can be found here .
It looks like AcceptGet and AcceptPost were created to fill the gap in one of the earlier versions of the ASP.NET Mvc framework. The AcceptGet and AcceptPost classes provided the strongly typed HttpMethod attribute.
ASP.NET MVC released with AcceptVerbs, which accepts an enumeration:
[Flags] public enum HttpVerbs { Delete = 8, Get = 1, Head = 0x10, Post = 2, Put = 4 }
My question is which one is the best implementation, AcceptGet / AcceptPost or AcceptVerbs (with the HttpVerbs enum type)?
source share