Introduction

In this article, we will see what is an API, why should we create it and how to create a simple Web API project.

What is Web API?

Web API is fully supported and extensible framework for building HTTP based endpoints. This framework makes it very easy to build HTTP services. It is built on top of ASP.NET. It does not dictate an architectural style but it’s a good platform to build RESTful applications.

Why should we use Web API?

Most of the time when any application needs a service layer, for example, HTML 5 application or mobile application or client server desktop application. In a real world scenario any mobile recharge company wants to expose endpoints to do the recharge, it has to create an API i.e. service layer and expose it to the world so that other companies can use that Uri and do the recharge.

Creating Web API

Let’s create our first Web API project
Here it seems that API in the route is mandatory but it is not like that. It is just a convention. You can remove ‘api’ from route template and still it works.

Conclusion

Here in this article we have seen only Get method, which means we have used only ‘GET’ http verb. In the next article we will see other HTTP methods like POST, PUT and DELETE.
Read more articles on ASP.NET:
Next >> All about API: Using HTTP Methods - Part Two