The HTTP verbs are required to work around with HTTP based APIs and other same protocols which require some HTTP verb to perform actions, such as
GET http://www.example.com/users/id
DELETE http://www.example.com/users/id
From the above URLs, you can easily tell which one would return a result and which one would remove the record (
depending on the application being used).
Now, coming to your question. Although it is
you who would implement the actual underlying code. So, it depends on you whether you delete that record or not and whether to return the record or return something else. It is just the way HTTP protocol was designed to create an intuition for the users and developers.
Other than this, if you want to use these verbs to do something else, you surely can. The underlying code would execute as you want it to. I can write the action method, which actually deletes the user from the database. Look below,
[HttpGet]
public ActionResult Index() {
ViewBag.Message = "User deleted";
return View();
}
Although the above code was to get the response (
not a user or other stuff, just response) but I added the code to delete something (
or the user). No error, and the record would also be deleted, provided no other error occurs.
The actual thing is that you should follow the protocol. Because, other developers have no idea what your function would do, unless the verb is specified. It is just to remove the ambiguity of the API of your application. Otherwise, you can surely do anything.
You can also remove that attribute from your application.