my delete method of axios didn't work while post method work my delete method of axios didn't work while post method work mongoose mongoose

my delete method of axios didn't work while post method work


The reason it works with POST and not DELETE is that the second parameter for axios.post() is the body, whereas the second parameter for axios.delete() is the axios config object. This is presumably because there has been some disagreement and change over time as to whether DELETE requests can or should have a body, and what should happen if they do.

You can pass data in the config object, as seen here.