Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1525

Axios - how to pass a list of values in a delete request [closed]

$
0
0

list

const postIds = [1, 2, 3]

How to pass the list of postIds posts to the server for deletion using axios?

Tried:

const response = await axios.delete(/api/posts/, {      data: { postIds },    });

But if we specify a route without the id ‘/api/posts/’, there will be a 404 error when we send the delete method request.

It is the list that needs to be passed, so that the backend can work with this list.


Viewing all articles
Browse latest Browse all 1525

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>