The Web Api (
Application Programming Interface) feature is based on a special kind of controller to an MVC framework application.
An api controller distinguishes itself from the normal controllers by the following :-
- Action methods return model, rather than an ActionResult in MVC, objects.
- Action methods are selected based on the HTTP method used in the request.
The model objects that are returned from an API controller action method are encoded as
JSON/XML based on the browsers used and sent to the client.