What is Web API and why use it?

In this post, I will explain Web API and why to use it. ASP.NET Web API(Introduced by Microsoft) is a framework for building HTTP services that can be used by other range of clients such as browsers, mobiles, iPhones, and tablets.

ASP.NET Web API can be considered an extension to WCF REST API. It is an alternative to WCF REST API. It can be used with any other types of Web applications like ASP.NET Core Web app and WebForms. Also, Web API can also be used as a stand-alone Web services application.

The actual need for web API

Today, in the fast-moving world a web-based application alone is not sufficient to reach all the targeted consumers. People are very smart, they vastly use iPhones, mobile, tablets, etc. devices in their daily life. These devices also have a lot of apps for making day-to-day life easier. In fact, we are moving from the web towards the app world.

Hence, if you like to introduce your service data to browsers and all of other these modern devices apps in a fast and reliable way, you need to have an API that is capable with modern browsers and all these devices.

Features of Web API

  • API responses contain Accept header and HTTP status code details.
  • It supports many text formats like XML, JSON, etc. or one can also use custom MediaTypeFormatter.
  • Provision for Self-hosting or IIS Hosting.
  • In-built support for ASP.Net features like action results, filters, model binders, routing, controllers

Conclusion

I hope you get an idea about What is Web API and why use it?.
I would like to have feedback on my blog
Your valuable feedback, question, or comments about this article are always welcome.
If you liked this post, don’t forget to share this.