Click here to Skip to main content
15,888,733 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Can we set HTTPPOST actionAttribute as default action in Mvc4? Please suggest as soon as possible.
Posted
Updated 10-Dec-15 23:13pm
v2

1 solution

what i understand :
The default action accept both POST and GET method, You can specify the HTTP method with using of the [HttpPost] attribute,

- can specify the HTTP method with an attribute: AcceptVerbs, HttpDelete, HttpGet, HttpHead, HttpOptions, HttpPatch, HttpPost, or HttpPut.

- Otherwise, if the name of the controller method starts with "Get", "Post", "Put", "Delete", "Head", "Options", or "Patch", then by convention the action supports that HTTP method.

- If none of the above, the method supports POST.


for more details you can navigate to Action Selection through this page :
http://www.asp.net/web-api/overview/web-api-routing-and-actions/routing-and-action-selection[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900