F
F
Floor is Java2022-03-15 17:44:33
Java
Floor is Java, 2022-03-15 17:44:33

How to do delete multiple items in RESTApi CRUD (DELETE or POST method)?

Hello, I usually encountered the need to remove elements one at a time.
To do this, I used @DeleteMapping ("users/{id}"), which is familiar to me.

Now I need to delete several elements at once through one request.
I can make a Post-method, in which I will pass the list of id for deletion in the body.
Or make a Delete method, to which I will pass several id array/list to the query (in the query string)?

Which approach is preferred?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2022-03-15
@floor_is_java

https://stackoverflow.com/a/50979689/1911548

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question