zfcampus / zf-rest

BSD 3-Clause "New" or "Revised" License
32 stars 37 forks source link

Content response for DELETE request #58

Open friendofpa opened 9 years ago

friendofpa commented 9 years ago

Would like to have content responses for a DELETE requests. Currently returns 204 (No Content) status code.

public function delete($id) {
    return true;
    // Would like to return a response like below on success..
    // return array('status' => 'deleted', 'id' => $id);
}
Maks3w commented 9 years ago

From http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html

A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, 202 (Accepted) if the action has not yet been enacted, or 204 (No Content) if the action has been enacted but the response does not include an entity.

So the developer should have the freedom of return an object.

weierophinney commented 4 years ago

This repository has been closed and moved to laminas-api-tools/api-tools-rest; a new issue has been opened at https://github.com/laminas-api-tools/api-tools-rest/issues/9.