Question

Default webapi route - api/{controller}/{id}

In realtime scenrios may require more get and post methods

Is it recommended to change this like default routing - api/{controller}/{action}/{id}

Was it helpful?

Solution

Usually default values are recommended values. You don't need to change this unless you have special requirements.

api/{controller}/{controller}/{id} is a non-sense because you don't have to display two times the name of the controller in the URL.

{action} is not everytime needed (if use of GET/PUT...). You may want to create api/{controller}/{action}/{id} as a second route or specify {action} in the default route as UrlParameter.Optional.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top