I send a delete request to server as like:
@RequestMapping(value = "/user/{userId}", method = RequestMethod.DELETE)
for a single user delete. However what to do when multiple users wants to be deleted? I want to obey REST architecture but I want to see the another ways from sending multiple delete requests?
PS: Is this a suitable way:
@RequestMapping(value = "/user", method = RequestMethod.DELETE, headers = "Accept=application/json")
public void deleteUser(HttpServletResponse response, @RequestBody String users) throws IOException {
...
}
since rest is resource oriented arch.
try design a higher level domain object which represents ‘multiple users’ resource ,
do delete on that object.
maybe
the great book ‘restful web services cookbook‘ by Subbu Allamaraju , oreilly , talk about this topic: