H
H
HellAzi2021-07-16 19:01:49
JavaScript
HellAzi, 2021-07-16 19:01:49

At the moment, I call an array with 100 elements through the fetch method, how to write metho: Delete so that not the entire array is deleted, but only one?

const API_URL = ' https://jsonplaceholder.typicode.com/posts ';

let posts = []

const getPost = () => {
fetch(APi_URL)

.then((response) => response.json())
.then((json) => console.log(json));
}


getPost()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Prog Spectar, 2021-07-16
@HellAzi

Deleting a resource
fetch(' https://jsonplaceholder.typicode.com/posts/1 ', {
method: 'DELETE',
});
From here: https://jsonplaceholder.typicode.com/guide/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question