Hello Friends, In this tutorial, I am going to introduce you about Web API in ASP.NET. The Web API is used to create HTTP services that can be used be many clients like browser, Mobile Phone.

After completing this tutorial you will be able to understand:

  • What is Web API  in ASP.NET?
  • Why should we use Web API?
  • When should to use Web API?


ASP.NET Web API is a framework for building HTTP Services. This HTTP Services can be consumed by many clients like Desktop, Mobile. ASP.NET Web API was introduced with MVC4. ASP.NET Web API is very similar to ASP.NET MVC because it contains many features of ASP.NET MVC application like Controllers, ActionResult, filter, Routing, Dependency Injection. But you cannot link an ASP.NET WEB API to ASP.NET MVC application. You can think an ASP.NET Web ASPI to separate application. It works with HTTP Verbs so it has the support of conviction based CRUD operation. An ASP.NET Web API application can be hosted with an ASP.NET MVC application.


Why we need ASP.NET Web API?

You can use an ASP.NET Web API when your application whether it is an HTML5 application, Mobile Application or desktop application needs a Services layer. In today’s life, everybody is moving from desktop to smartphone, tablets, phone. These devices have apps that make thing simpler. So, in short, we are moving from the web to app world.

ASP.NET WEB API provides a platform for building services to expose your application’s data to different devices.

When should we use Web API?

  • We can use Web API when we want to create a Web Service but we don’t want to use SOAP.
  • Since it is light weight so we can use Web API for that have limited bandwidth.


Hope you understand this tutorial about Web API in ASP.NET and when should we use Web API in our projects. I will appreciate your feedback, comments and suggestions.

View More:

Thank You.