2. What is Web API
Type of application programming interface (API)
Client and server based
Content focused
Processed through HTTP Requests and Responses (Most commonly)
4. Representational State Transfer (REST)
Architecture for coordinated set of constraints for HTTP transfers
POST GET
PUT DELETE
5. RESTful Constraints
Client–server – Separate UI from Server functions
Stateless – Each request has all the needed data
Cacheable – implicitly or explicitly, define as cacheable
Layered system – client does not depend on end server connection
Uniform interface – uniform interface simplifies and decouples the architecture
6. Why Web API
Allows for a scalable, decoupled development of a Web Service.
Can easily be shared and used by other developers to access your web service.
It is Used to build simple, non-SOAP-based HTTP Services on top of existing WCF message
pipeline.
It doesn't have tedious and extensive configuration like WCF REST service.
It is only based on HTTP and easy to define, expose and consume in a REST-ful way.
It is light weight architecture and good for devices which have limited bandwidth like smart
phones.
It is open source.
7. Web API vs WCF
WCF Web API
Transport protocols (HTTP, TCP,
UDP,..)
HTTP only. More suitable for
access from various devices
Encodings (Text, MTOM, and
Binary)
wide variety of media types
including XML, JSON etc.
WS-* standards like Reliable
Messaging, Transactions,
Message Security.
There is no support for higher
level protocols such as Reliable
Messaging or Transactions.
Supports Request-Reply, One
Way, and Duplex message
exchange patterns.
HTTP is request/response