fetch('https://reqres.in/api/users/2', { method: "DELETE", headers: { 'Content-type': 'application/json' } }) .then(res => { if (res.ok) { console.log("HTTP request successful") } else { console.log("HTTP request unsuccessful") } return res }) .then(res => res.json()) .then(data => console.log(data)) .catch(error => console.log(error))