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.

  1. Uniform interface: All requests to the same resource should look and perform the same.

  2. Client–server architecture: The client and server should be decoupled and independent of each other.

  3. Statelessness: Each request to the server should be understood in isolation.

  4. Cacheability: Due to the nature of 1 and 3, responses can and should (wherever possible) be cached for future requests.

  5. 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.

  6. Code on demand (optional): Servers can provide temporary extensions for the client by sending executable scripts on demand.

 

This page is a preview of Build and deploy a REST API with Deno

Start a new discussion. All notification go to the author.