how to create a delete request with fetch api code example
Example: js fetch delete
fetch('https://example.com/delete', {
method: 'DELETE'
})
.then(res => res.json())
.then(data => {
// Do some stuff...
})
.catch(err => console.log(err));