문제

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}

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top