Sunday, March 8, 2020

Introduction to ASP.NET Web API


Here in this article I am going to give you introduction of ASP.Net Web API.


ASP.NET Web API
API stands for application programming interface. ASP.NET Web API is a framework developed by Microsoft, which is used to build HTTP based services. It processes the information/data between two applications and returns the data in XML or JSON format. API can be accessed by a broad range of clients like browsers, mobile, IOT, desktop application etc. It is an ideal platform for building RESTful services.

ASP.Net Web API features & Advantages :
  1. Web API is an ideal platform for building RESTful services.
  2. Can develop cross domain application.
  3. Web API has lightweight architecture and easy to use.
  4. It has the ability to be hosted in IIS as well as self-host outside of IIS.
  5. It supports full features of HTTP verbs like Get, Put, Post and Delete for all CRUD operations.
  6. Supports different formats of response data like XML, JSON etc. using MediaTypeFormatter.
  7. Support for OData
  8. It supports for ASP.Net MVC features like Controller, Action, Routing, dependency injection etc.


What are RESTful services?
REST stands for Representational State Transfer. It was first presented by Roy Fielding in 2000. It is an architectural pattern for designing loosely coupled applications over HTTP, that is often used in the development of web services. REST architectural pattern specify the set of 6 constraints which make any service a true RESTful API.
  1. Stateless
  2. Uniform interface
  3. Client-Server
  4. Cacheable
  5. Layered system
  6. Code on demand


Following HTTP methods are most commonly used in a REST based architecture.
GET : Used to retrieve resource information only.
POST : Used to update existing resource or create a new resource.
PUT : Used to update existing resource.
DELETE : Used to remove/delete a resource.



No comments:

Post a Comment