Posts

Showing posts from December, 2017

RESTful API Designing guidelines — The best practices

1) Terminologies The following are the most important terms related to REST APIs Resource is an object or representation of something, which has some associated data with it and there can be set of methods to operate on it. E.g. Animals, schools and employees are resources and delete, add, update are the operations to be performed on these resources.Collections are set of resources, e.g Companies is the collection of Company resource.URL (Uniform Resource Locator) is a path through which a resource can be located and some actions can be performed on it. 2) API endpoint Let’s write few APIs for Companies which has some Employees, to understand more.
/getAllEmployees is an API which will respond with the list of employees. Few more APIs around a Company will look like as follows: /addNewEmployee/updateEmployee/deleteEmployee/deleteAllEmployees/promoteEmployee/promoteAllEmployees And there will be tons of other API endpoints like these for different operations. All of those will contain man…

What is REST?

REPRESENTATIONAL STATE TRANSFER REST, or REpresentational State Transfer, is an architectural style for providing standards between computer systems on the web, making it easier for systems to communicate with each other. REST-compliant systems, often called RESTful systems, are characterized by how they are stateless and separate the concerns of client and server. We will go into what these terms mean and why they are beneficial characteristics for services on the Web. SEPARATION OF CLIENT AND SERVER In the REST architectural style, the implementation of the client and the implementation of the server can be done independently without each knowing about the other. This means that the code on the client side can be changed at any time without affecting the operation of the server, and the code on the server side can be changed without affecting the operation of the client. As long as each side knows what format of messages to send to the other, they can be kept modular and separate. …