API-Rest directory listing

Api REST, APIs and RESTful. What are they? How do they work?

Welcome to Api REST, today is a remarkable day. We are so delighted to bring to your cognizance that API-Rest is launched !! This website is established to explain in details and very fundamental and easy way how to design and build RESTful, APIs. So We are going to commence with the history expatiating the genesis of this wonderful site.

REST which stands for Representational state transmissions was started by Mr. Roy Fielding back then when he was still studying for the obtainment of his PhD in the year 2000, and really in the chapter five of his treaties. ( In fact, this man is deemed fit for an honorary Nobel prize). It was then a mere architecture but as at this era, it has drastically developed into an indispensable tool and is been consequently adopted by countless web gurus.

REST made provisions for a group of architectural constraints such that when applied as a whole, reiterate the scalability of constituents interactions, general conceptions of interfaces, independent mobilization of components, and intermediate constituents which inhibit the interaction dormancy, enhance security, and epitomize legacy systems. I will expatiate the software principles of engineering governing REST and the interaction constraints assigned to withhold those principles, while making them contrary to the constraints accompanying other architectural mechanisms.

Mr. Roy Fielding observed 6 constraints which must be emphasized in order to get the best result from the API architecture. Therefore the constituents enlisted by Mr. Roy would be carefully outlined and explained in the succeeding paragraph :

  1. Client-Server.
  2. Stateless.
  3. Cache.
  4. Uniform Interface.
  5. Layered System.
  6. Code-On-Demand.

Before we proceed into the explanation of each constraint, there is need to emplace a null or empty group of constraint which are going to be added cumulatively. This implies that the limit between components is zero.

  1. Client-Server

  2. Client-Server This very first constraint implies entirely the deviation of concerns between the extreme-ends in order that the user interface should be deviated from the logic. Having done that, then we have to improve the portability of the user interface beyond various platforms so that we can easily toggle between different front-end framework or library for many clients. Moreover, the scalability of the server is advanced by simplifying its logic constituents and deviating it from any visual symbols.

  3. Stateless

  4. The communication between the server and the client cannot be constrained by the contextual data being stored on the server between requests. The request from each and every client comprises in full the data essential to service the request, the session state resides in the client, the session state us capable of being transmitted from the server to another service, taking a database for instance, in order to retain a constant state of a period and enhance authentication. When the client is prepared to commence transition from one state to another then it starts sending request, As soon as some requests are noticeable, the client is said to be in transition. In case the client intends to actuate a new transition of states another time, the state in which each application is represented could be used to initiate the process I.e state transition.

  5. Cache

  6. For instance, Clients and intermediaries are able to cache feedbacks on the worldwide web, for that reason, responses or feedbacks in any case must be cacheable in order to avoid the reuse of an improper file in response to the subsequent request. For the enablement of scalability and proper performance in caching, it is ideal to ensure that it's well managed so as to eliminate totally or averagely some client-server interactions.

  7. Uniform Interface

  8. Any REST service is designed on the basis of its uniform interface constraint, the activities of the uniform interface such as the simplification and the separation of the architecture so that each part can emerge irrespective of one another. The uniform interface further comprises of some other constraints such as identification of resources, manipulation of resources through the existing medium in the preceding constraints, self descriptive message and hypermedia as the engine of application state (HATEOAS).

    1. Identification of ressources

    2. Resources are identified individually in request for instance, when URIs are used together with REST in a web-based system. The representations which are turned to the client are ideally different from the resources themselves, for instance server may send in various extensions such as XML,JSON,HTML whereby not a single of these is internal representation.

    3. Manipulation Of Resources through existing Representations

    4. A client has the proper data to discard or modify any representation of a resource including any attached metadata.

    5. Self-descriptive message

    6. Each message comprises enough data to describe how it should be processed, for example, the internet media type can determine which parser to employ, previously known as a MIME

    7. Hypermedia as the engine of application state ( HATEOAS )

    8. Clients effect state transition through actions only which are continuously recognized within hypermedia by the server. Aside from some standard points of entry to the application, in no circumstances should a client thinks that any specific action is accessible for any certain resources more than those mentioned in representation which was formerly accepted from the server.

  9. Layered System

  10. Normally, the state of connections cannot be determined by a client I.e whether it's connected to an end server or to an intermediate along the routes. Intermediate servers give some advantages such as load stabilization, advancement of system scalability and they even have the capacity to implement policies having to do with its security.

  11. Code On Demand

  12. Servers are able to intermittently expand or personalize the activity of a client using the transmissions of executable set of codes. The likes of these include the client-side script e.g JavaScript and java applets. Among the carefully outlined constraints of architecture, Code Of Demand is the only optional constraints

Applications to web services

  • RESTful APIs are web service APIs that functions on the basis of REST architectural constraint.
  • HTTP-based RESTful APIs are described in the following forms base URI, for instance, internet resources.
  • An Internet media type for the data, this is often JSON but can be any other varieties of Internet media type (e.g., Atom, XML, microformat, hypertext links to reference state hypertext links to reference-related resources)