Web Api is REST based service on web works on http or https.
REST - Representational State Transfer
Facts
Rest Facts
- Client-Server model: Its client server model but there is no coupling, completely decoupled model.
- Statelessness: Web API is rest based service, is request has complete information to serve, there is no state management.
- Catchability: Data can be cached for better performance.
- 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.
- Uniform Interface -
- Unique identification
- Resource manipulation through representation
- Self descriptive message
Facts About Web API
- Web API controller inherit ControllerBase class while MVC controller inherits Controller class.
- Web API returns only data while MVC controller can return view or partial view as well.
- What is content Negotiation?
Web API can return data format based on "Accept" request header. - 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