Tuesday, August 23, 2016

Hypermedia API

An API is a contract or an agreement between the provider and the consumer. This agreement decides the protocol, mechanism, input and the output of an API.

There are many different types of API’s. The programming language itself comes with a rich set of API which can be leveraged for performing common functions.

Then there are API’s that can be consumed across machines. The RPC, SOAP & REST provides mechanism for the API’s to be consumed from across the machines and over the web.

REST API’s has become quiet popular because of their simplicity and unambiguous mechanism
through which it exposes its various operations. But REST has a few limitation
  1.  The vocabulary is not standardized in REST. The input and the output parameter names are specific to the provider and the same parameter might mean a different thing when it comes to another provider
  2. It doesn’t lead to self-discovery of API’s. Knowing the API for creating a product doesn’t reveal any information about what else can be done with that provider. May the provider also provides API to view, update and delete the product? The API signature of these operations needs to be known to the developer in advance for him to build those functions

The Hypermedia API address these two major problem with the REST. It provides a standard vocabulary for all providers and consumers to use. And it provides mechanism for exposing follow up operations that can be performed.


And it does this by including hyperlinks within the response, pointing to the endpoints for other operations, hence the name Hypermedia API.

-------------------------------------------------------------------------------------------------------------------------

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home