Saturday, April 5, 2025

Web API Facts

Web Api is REST based service on web works on http or https.

REST - Representational State Transfer 

Facts 

Rest Facts

  1. Client-Server model: Its client server model but there is no coupling, completely decoupled model.
  2. Statelessness: Web API is rest based service, is request has complete information to serve, there is no state management.
  3. Catchability: Data can be cached for better performance.
  4. Layered system: There might be multiple layers at service end, client doesn't need to care about it. When client calling an endpoint, that might be an intermediate endpoint.
  5. Uniform Interface - 
    • Unique identification
    • Resource manipulation through representation
    • Self descriptive message


Facts About Web API

  1. Web API controller inherit ControllerBase class while MVC controller inherits Controller class.
  2. Web API returns only data while MVC controller can return view or partial view as well.
  3. What is content Negotiation?
    Web API can return data format based on "Accept" request header.


  4. Web API Vs WCF



WCF Rest Vs WA Rest: Web API built for Rest only from start, while Rest is added with WCF later.

No comments:

Post a Comment

CI/CD - Safe DB Changes/Migrations

Safe DB Migrations means updating your database schema without breaking the running application and without downtime . In real systems (A...