If I create a webApi controller
, and populate it with methods prefixed with http verbs, the Api is able to correctly imply what verb should be used on that controller.
public class TestController : ApiController
{
public string GetData()
{
return "Called Get Method";
}
public string PostData()
{
return "Called Post Method";
}
public string PutData()
{
return "Called Put Method";
}
}
If I replace the Post
with Update
, the Post method continues to work implicitly.
public string UpdateData()
{
return "Called Updated Method";
}
Is there a list of the possible prefixes on a method and what verb they map to? Additionally, is it possible to define custom prefixes? For instance, if I wanted to always map a method starting with "Search" to a Post
, can I define this?