Web API

Tharmika Kulendran
2 min readMar 2, 2020

--

sample web api project on asp.net

API stands for Application Program Interface. API is some kind of interface which has a set of functions that allow programmers to access specific features. I read a simple story for the API in one of the site . I would like to share to you. Consider , you are the customer (client) and visiting a hotel but that time servant is not there but menu on that table . So, you can select the item from that menu and tell to the servant .That servant sent your preference to the cook then whatever cook gave to you .You take it the customer. Similar servant act as API and the customer like a browser ( desktop application or mobile application).

A Web API is an application programming interface for either a web server or a web browser.

Next we consider the example by using asp.net web api project. Following senario simply describe the sample of web api project ,

Http client sent the Request through the IIS Server (Internet Information Services) to Http Server . Then the Http Server convert the Request as a HttpRequest in the web api config file contains some general delegate handler (in your wish to wrote the delegate handle). That delegate handler checks delegate logic and pass it to routing selector. After checks wheather request has any route delegate handler if it yes, solve the route delegate handler then pass it Controller Selector and activator section or otherwise sent it directlly here. if that application have any authentication filter checks the authorization then pass it model binding (It is also your preference). Action filter part have two type one is OnActionExecuting other oneOnActionExecuted first checks OnActionExecuting then sent it to Web api . Web api converts the request as a responce then check oneOnActionExecuted ,result conversion(It is also your preference).Finally raised the client some of project have Excecption filter that mean using try, catch methods for error check.

--

--

Tharmika Kulendran

I enjoy learning new things and can assimilate new ideas quickly.