What is the difference between [AcceptVerbs(HttpVerbs.Post)] and [HttpPost]?
问题 I can decorate an action either with the [AcceptVerbs(HttpVerbs.Post)]/[AcceptVerbs(HttpVerbs.Get)] [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create(string title) { // Do Something... } or with the [HttpPost]/[HttpGet] attributes [HttpPost] public ActionResult Create(string title) { // Do Something... } Are they different? 回答1: Nothing. One is just shorthand for the other. 回答2: [HttpPost] is shorthand for [AcceptVerbs(HttpVerbs.Post)] . The only difference is that you can't use