Building a Simple Web API

In this article we are going to create a simple Web API, that basically exposes an in-memory List<Student> over HTTP, for a client application to play with the list members.

Although this article would have relatively limited applicability to a practical web API implementation, it is a foundation toward understanding how to use the ASP.NET Web API framework to build your web API.

Step 1

Run Visual Studio and create a new ASP.NET Web Application. Give the project a name of StudentAPI. Select the ‘Web API’ template which will automatically select MVC and Web API Checkboxes. For now you can leave Authentication method use for API by default it is “No Authentication”.

Continue reading