Your MVC controller is where the magic happens. Requests come in from the end-user, then content and data get returned. What happens in between is up to you-the developer.
By default, controller methods can be used for HTTP GET
requests using the [HttpGet]
attribute or omitting this action verb attribute altogether, as it is the default behavior. Most likely, you have already been using the following HTTP GET
and POST
verbs:
HttpGet
: Uses the HTTPGET
method with optionalquerystring
parametersHttpPut
: Uses the HTTPPOST
method for form submissions to create an entity
In addition to the preceding, you should also be aware of additional HTTP verbs that can be used as controller attributes; they are as follows:
HttpPut
: Uses the HTTPPUT
method to edit an existing entityHttpDelete
: Uses the HTTPDELETE
method to delete an existing entityHttpPatch
: Allows partial model updates instead of a fullPUT
requestAcceptVerbs
: Allows multiple action verbs to...