问题
Does ASP.NET MVC support RESTful architecture by default?
What I want to know is, if I want to develop a RESTful kind of project, need I to specially work anything on ASP.NET MVC or it will support this feature by default?
回答1:
If you use Controllers to represent resources and simply implement "actions" that are equal to the HTTP methods, then you can produce a RESTful system very easily with ASP.NET MVC.
回答2:
MVC has been created with REST in mind. It is REST-friendly but not 100% REST compliant, especially when it comes to content-negotiation - although you can implement it yourself on the top of MVC.
回答3:
ASP.NET MVC does promote a REST architecture.
See:
- The REST-Like Aspect Of ASP.NET MVC - Phil Haack, Nov 2007
- Rest For ASP.NET MVC SDK and Sample - Phil Haack, Aug 2009
来源:https://stackoverflow.com/questions/5666293/asp-net-mvc-restful-architecture