CRUD Operation?
The acronym CRUD stands for Create, Read, Update and Delete.
Create: Inserts a new data
Read: Read the data
Update: Update the existing data
Delete: Delete the existing data
List of HTTP Request methods
GET — is used to request data from a specified resource.
POST — is used to send data to a server to create a resource.
PUT — is used to send data to a server to update a resource.
DELETE — is used to delete the specified resource.
REST API Server ?
If you’re performing CRUD operation using Fetch API you’re going to need a REST API server.
JSONPlaceholder is a free online REST API that you can use whenever you need some fake data. It’s great for learning, tutorials, testing new libraries, sharing code-examples.
Fetch API
GET Posts
url — https://jsonplaceholder.typicode.com/posts
Console
CREATE a Post
url — https://jsonplaceholder.typicode.com/posts
methods — POST
UPDATE a Post
url — https://jsonplaceholder.typicode.com/posts
methods — PUT
DELETE a Post
url — https://jsonplaceholder.typicode.com/posts/00 is a post id, so we are going to delete a post where the id = 0
methods - DELETE