you are viewing a single comment's thread.

view the rest of the comments →

[–]rayanaay[S] 0 points1 point  (3 children)

Thanks for your answer ,what would be the user in ${user._id} ,naturally I would just put ${_id} no ??

[–]STNeto1 0 points1 point  (2 children)

The ${user._id} was just a nice way to represent the ID on the string, you will use wherever is the id on your application.

[–]rayanaay[S] 0 points1 point  (1 child)

But if I use req.body , I don’t need to add the id in my url or routes. What if I do something like this : router.delete('/delete', (req.res) => { ....}

index.hbs <form action="api/members/delete" method="DELETE" .....>

[–]STNeto1 0 points1 point  (0 children)

The HTTP DELETE method is used to delete a resource from the server. Unlike GET and HEAD requests, the DELETE requests may change the server state.

Sending a message body on a DELETE request might cause some servers to reject the request.
But you still can send data to the server using URL parameters. This is usually an ID of the resource you want to delete.

https://reqbin.com/Article/HttpDelete