Q: How would I make a DELETE request?
See original GitHub issueI tried something like this:
function deleteData(item, url) {
  fetch(url + '/' + item, {
    method: 'delete'
  }).then(response =>
    response.json().then(json => {
      return json;
    })
  );
}
and I get Uncaught TypeError: Cannot read property 'then' of undefined
Issue Analytics
- State:
 - Created 8 years ago
 - Comments:5
 
Top Results From Across the Web
Simple DELETE request using fetch API by making custom ...
js file, first create an ES6 class DeleteHTTP and within that class, there is async fetch() function which DELETES the data from the...
Read more >How do I send HTTP DELETE request? - ReqBin
In this HTTP DELETE request example, we send a DELETE request to the ReqBin echo URL to remove a resource from the server....
Read more >How can I send a http delete request from browser?
As someone mentioned above, jQuery will do this for you, via the following syntax: $.ajax({ type: "DELETE", url: "delete_script.php", data: "name=someValue" ...
Read more >How to create a DELETE request in Postman? - Tutorialspoint
Before creating a DELETE request, we shall first send a GET request to the server on the endpoint :http://dummy.restapiexample.com/api/v1/ ...
Read more >How to send DELETE request using REST assured? - Tools QA
Delete method response is non-cacheable. The user cannot cache the server response for later use. Caching a delete request creates ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

A bit late to this but you could improve on it like
response.json()already returns a promise with json, so the last.thenis unnecessary.@theopak yeah, what I was doing wrong - forgot to
returnthe promise. So should look like: