filmov
tv
Online fake REST API
Показать описание
In this video we will discuss creating a fake online REST API.
Text version of the video
Healthy diet is very important for both body and mind. We want to inspire you to cook and eat healthy. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking.
Slides
Angular CRUD Tutorial
Angular CRUD Tutorial Text Articles & Slides
All Dot Net and SQL Server Tutorials in English
All Dot Net and SQL Server Tutorials in Arabic
What is REST API
REST stands for Representational State Transfer. REST is an architectural pattern for creating an API that uses HTTP as its underlying communication method.
The REST architectural pattern specifies a set of constraints that a system should adhere to. Some of these constraints are Client Server constraint, Stateless constraint, Cacheable constraint, Uniform Interface constraint etc. We discussed these constraints in Part 1 of ASP.NET Web API tutorial. Let's quickly recap the Uniform Interface constraint.
Uniform Interface - The uniform interface constraint defines the interface between the client and the server. To understand the uniform interface constraint, we need to understand what a resource is and the HTTP verbs - GET, PUT, POST & DELETE.
In the context of a REST API, a resource typically represents a data entity like Product, Employee, Customer etc. The HTTP verb (GET, PUT, POST, DELETE) that is sent with each request tells the API what to do with the resource. Each resource is identified by a specific URI (Uniform Resource Identifier) or URL (Uniform Resource Locator). The following table shows some typical requests that you see in an API.
Resource Verb Outcome
/Employees GET Gets list of employees
/Employees/1 GET Gets employee with Id = 1
/Employees POST Creates a new employee
/Employees/1 PUT Updates employee with Id = 1
/Employees/1 DELETE Deletes employee with Id = 1
Depending on the server side technology you use, there are many frameworks that we can use to build a REST API. For example, if your server side technology is Microsoft Dot Net, you can use WCF or ASP.NET Web API to create a REST API.
Since this is an Angular course, and to stay focused on it, let's create a fake REST API using JSON Server. In our upcoming videos, we will perform all the CRUD operations using this fake REST API.
The following is the JSON Server Github page
Execute the following command to install JSON server
npm install -g json-server
Execute the following command to start the server
Text version of the video
Healthy diet is very important for both body and mind. We want to inspire you to cook and eat healthy. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking.
Slides
Angular CRUD Tutorial
Angular CRUD Tutorial Text Articles & Slides
All Dot Net and SQL Server Tutorials in English
All Dot Net and SQL Server Tutorials in Arabic
What is REST API
REST stands for Representational State Transfer. REST is an architectural pattern for creating an API that uses HTTP as its underlying communication method.
The REST architectural pattern specifies a set of constraints that a system should adhere to. Some of these constraints are Client Server constraint, Stateless constraint, Cacheable constraint, Uniform Interface constraint etc. We discussed these constraints in Part 1 of ASP.NET Web API tutorial. Let's quickly recap the Uniform Interface constraint.
Uniform Interface - The uniform interface constraint defines the interface between the client and the server. To understand the uniform interface constraint, we need to understand what a resource is and the HTTP verbs - GET, PUT, POST & DELETE.
In the context of a REST API, a resource typically represents a data entity like Product, Employee, Customer etc. The HTTP verb (GET, PUT, POST, DELETE) that is sent with each request tells the API what to do with the resource. Each resource is identified by a specific URI (Uniform Resource Identifier) or URL (Uniform Resource Locator). The following table shows some typical requests that you see in an API.
Resource Verb Outcome
/Employees GET Gets list of employees
/Employees/1 GET Gets employee with Id = 1
/Employees POST Creates a new employee
/Employees/1 PUT Updates employee with Id = 1
/Employees/1 DELETE Deletes employee with Id = 1
Depending on the server side technology you use, there are many frameworks that we can use to build a REST API. For example, if your server side technology is Microsoft Dot Net, you can use WCF or ASP.NET Web API to create a REST API.
Since this is an Angular course, and to stay focused on it, let's create a fake REST API using JSON Server. In our upcoming videos, we will perform all the CRUD operations using this fake REST API.
The following is the JSON Server Github page
Execute the following command to install JSON server
npm install -g json-server
Execute the following command to start the server
Комментарии