ASP.NET WebApi vs MVC ?

Hugo Zapata

With ASP.NET MVC controllers you can expose your data in different formats. AspNetWebAPI is designed explicitly for creating API's but i can easily do that with MVC controllers, is not clear to me in what cases it would be better than traditional MVC controllers. I'm interested in scenarios where the benefits of WebApi are obvious and it would be worthy to add another complexity layer to my applications.

Question: what are the advantages and/or disadvantages of using asp.net WebApi in respect to MVC ?

Yusubov

WebApi allows to create services that can be exposed over HTTP rather than through a formal service such as WCF or SOAP. Another difference is in the way how WebApi uses Http protocol and makes it truly First class Http citizen.

UPDATE: The ASP.NET Core, Web API has been integrated into MVC project type. The ApiController class is consolidated into the Controller class. More at: https://wildermuth.com/2016/05/10/Writing-API-Controllers-in-ASP-NET-MVC-6

A relevant link of comparison, discussions & tutorials:

enter image description here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

ASP.NET MVC vs Spring MVC

Redirect() vs RedirectPermanent() in ASP.NET MVC

Using WebAPI or MVC to return JSON in ASP.NET

(headless) integration testing frameworks for asp.net mvc/webapi 5

What's the WebApi [FromUri] equivalent in ASP.NET MVC?

ASP.Net MVC 6 + WebAPI Auth - Redirect MVC to logon but 401 if WebAPI

ASP.NET WebAPI 2.2 SPA with social login and no MVC dependencies

ASP.NET MVC Core WebAPI project not returning html

Asp.Net Core - MVC Vs WebAPI routing difference

ASP.NET WebAPI vs MVC subtle behavioural deviations when it comes to json-(de)serialization of parameters

ASP.NET MVC and WebAPI inserting and retriveing records with database table

How to build asp.net webApI and aurelia in VS online together?

Moq Unit Test case - ASP.NET MVC with WebAPI

Asp.net core blazor vs .net core mvc with razor

Spring MVC vs ASP.NET (MVC?)

How do I pass data from an ASP.NET WebAPI ApiController to an ASP.NET MVC Controller?

ASP.NET MVC with Forms Auth and WebApi with Basic Auth

Asp.Net MVC, WebApi and Correct Asynchronous Approach

ASP.NET MVC WebAPI in Application Area

Differentiate between MVC and WebAPI in ASP.NET 5 / MVC 6

ASP.NET MVC ExecuteResult vs ActionResult

How to post file using Curl in WebApi in Asp.Net MVC

ASP.NET MVC and WebAPI on same domain

Auth0 with .Net Core ASP MVC to WebAPI Authentication

Can ASP.Net MVC be used as an API in place of WebAPI?

ASP.NET Core WebAPI: Memory Caching vs Response Caching

Ignoring route parameters in ASP.NET MVC WebAPI

ASP.Net MVC WebAPI - How to display json data in View

Add area in Asp.net MVC in vs code or .net cli