Koa.js There are 5 constraints Uniform interface Stateless Cacheable Client-Server Layered System 1.Uniform interface URIs refer to distinct services based on the http standard. HTTP requests consist of a header, body, and query parameters, whereas URI responses consist of a header, status, and body. verbs in HTTP (GET ,PUT ,POST ,DELETE) Example: Create faculties Insert new resource - POST /faculties Fetch a resource - GET /faculties Replace existing resources PUT / faculties / {faculty id} Delete resource DELETE /faculties/{faculty id} Update resource PATCH /faculties/{faculty id} Versioning of Rest APIs is also crucial. because it will serve in the long run when newer API versions are available Versioning is a type of text used to distinguish URIs. As a example: POST v1 /faculties GET v1 /faculties PUT v1/faculties /{faculty id} Query parameters In the REST API, query arguments are valid situations. Query parameters are optional parameters that are used to indicate which opera...
This ultimate guide cover all the important aspects of programming. Find out how to begin programming or to make yours even better!