In past few week we have working with REST API, and how it works. we have learned lot of thing about REST-API code and how you implement them to create WEB-order. Today I am going to tack about what is REST API is and how do you implement them using Docker Plate-form. So, What is REST API? REST API acronym is REpresentational State Transfer. There are six Guiding Principles of REST. Client-server, stateless, Cacheable, Uniform interface, Layered system, Code on demand witch is optional.
Client server is Separating the user interface concerns from the data storage concern. Stateless Each request from client to server must contain all of the information necessary to understand the request, and cannot take advantage of any stored context on the server. Session state is therefore kept entirely on the client. Cacheable Cache constraints require that the data within a response to a request be implicitly or explicitly labeled as cacheable or non-cacheable. Uniform interface is applying the software engineering principle of generality to the component interface, the overall system architecture is simplified and the visibility of interactions is improved. Layered system is style layered, it allows an architecture to be composed of hierarchical layers by construing component behavior such that each component cannot “see” beyond the immediate layer with witch they are interacting. Code on demand witch is REST allows client functionality to be extended by downloading and executing code in the form of applets or scripts. This simplifies clients by reducing the number of features required to be pre-implemented.
The Key abstraction of information in REST is a resource. Any information that can be named can be a resource: a document or image, a temporal service, a collection of other resources, a non-virtual object (e.g. a person), and so on. REST uses a resource identifier to identify the particular resource involved in an interaction between components.
Another important thing associated with REST is resource methods to be used to perform the desired transition. A large number of people wrongly relate resource methods to HTTP GET/PUT/POST/DELETE methods. A lot of people prefer to compare HTTP with REST. REST and HTTP are not same.
Here is example of REST-API from .YML file. In this file you write docker script file to tell how your website to be. In this file image you see the tag, summary, operationID, Response for each code and much more…
Resources: https://gitlab.com/LibreFoodPantry/training/microservices-activities https://searchapparchitecture.techtarget.com/definition/RESTful-API
From the blog CS@Worcester – </electrons> by 3electrones and used with permission of the author. All other rights reserved by the author.