REST API Introduction
Introduction to the concept of REST APIs and why we use them
An introduction to REST APIs#
By getting this far, you have gained the insight needed to work with the different tools and components for creating a REST API using Deno. You have learned how to use Deno, how to connect to a database, and how to handle migrations. Now we will combine everything to create a real-world application.
There are sixRESTful principles which should be followed to ensure that architectural expectations are fulfilled.
Uniform interface: All requests to the same resource should look and perform the same.
Client–server architecture: The client and server should be decoupled and independent of each other.
Statelessness: Each request to the server should be understood in isolation.
Cacheability: Due to the nature of 1 and 3, responses can and should (wherever possible) be cached for future requests.
Layered system: The server and the client should not need to know where each other are located or which proxies or intermediate systems are in between, and should work without changing the code if changes in the chain are applied.
Code on demand (optional): Servers can provide temporary extensions for the client by sending executable scripts on demand.