0

Why would one use ASP.NET Web API Controller when we can return JSON using MVC controller?

  • 1
    Different pipes, same result - minor changes. you can use a web api controller in a MVC project, it's just easier for apis IMO. – Royi Mindel Jan 14 '18 at 19:54

1 Answers1

2

Data formats, content negotiation, self-hosting(avoiding IIS) and importance of method signature are the key reasons to use web api. Please have a look at the following links and it will help you in understanding the difference between the both:-

http://www.binaryintellect.net/articles/7bfdd512-91e3-49a4-865d-6dd03ace73fb.aspx

Using WebAPI or MVC to return JSON in ASP.NET

Atul Chaudhary
  • 3,698
  • 1
  • 31
  • 51