ActionVerbs are type of attributes, when you apply these attributes to action method that indicate what kind of Http request the action method supports
In Asp.net MVC framework there are different ActionVerbs selectors attribute like HttpGet, HttpPost, HttpPut, HttpDelete, HttpOptions, HttpPatch.
If you do not specify any attribute on an action then it considers it a [HttpGet] request by default.
We can use action verbs like attribute [HttpGet]
on top of action method like example below.
[HttpGet] public ActionResult index() { return View(); }
public class customerController : Controller { [HttpGet] public ActionResult index() { return View(); } [HttpPost] public ActionResult index(customer model) { return View("index"); } [HttpPost] public ActionResult PostCustomer() { return View("index"); } [HttpDelete] public ActionResult DeleteCustomer() { return View("index"); } [HttpPut] public ActionResult PutCustomer() { return View(); } [HttpPatch] public ActionResult PatchCustomer() { return View(); } [HttpOptions] public ActionResult OptionsCustomer() { return View(); } }
Most of the time we use Get and Post in application development, Get is default, if you don’t specify anything then that's considered as HttpGet.