laminas-api-tools / api-tools

Laminas API Tools module for Laminas
https://api-tools.getlaminas.org/documentation
BSD 3-Clause "New" or "Revised" License
37 stars 19 forks source link

Some suggestion on DELETE Method #68

Open michalbundyra opened 4 years ago

michalbundyra commented 4 years ago
  1. delete() and deleteList() method in Resource objects needs accept data from request body, since in such scenario, user need to give comments on why this action happens and provides other related information.
  2. I think it's better to return 202 Accepted as response for DELETE method, better than 204 no content.

Originally posted by @snowwolf007cn at https://github.com/zfcampus/zf-apigility/issues/49

michalbundyra commented 4 years ago

Agreed with (1); I'll work on that for either 1.0.3 or 1.1.0.

As for (2), 202 indicates the request has been accepted, but not processed. In the majority of cases, this is likely entirely incorrect, and 204 is the more accurate case (as there is no content returned, as the resource no longer exists to be represented).


Originally posted by @weierophinney at https://github.com/zfcampus/zf-apigility/issues/49#issuecomment-45663763