Difference Between ASP.NET Web API and AS.NET MVC.
Difference Between ASP.NET Web API and AS.NET MVC.
1. ASP.NET MVC is used to create web applications that return both views and data but ASP.NET Web API is used to create REST full HTTP services with an easy and simple way that returns only data, not view.
2. Web APT helps to build Restful services over the •Net Framework and it also supports content negotiation, self-hosting which are not in MVC.
"Content negotiation (it's about deciding the best response format data that could be acceptable by the client. It could be ISON, XML, ATOM, or other formatted data)
3. In Web API the request is mapped to the action based on HTTP verbs but in MVC it's mapped to actions name.
4. Web API also takes care of returning data in particular format Jike JSON, XML, or any other based upon the Accept header in the request and we don't worry about that •MVC only return data in JSON format using JSON Resolt.
5. We can mix WEB API and MVC controller in a single project to handle advanced AJAX requests which may return data in JSON, XML, or any other format, and build full-do con HTTP services. Typically, this will be called Web API self-hosting.
6. WEB API is lightweight architecture and except for the web application, it can also be used with smartphone apps.
Comments
Post a Comment