I am currently designing a JSON RESTful API which should have a boolean endpoint such as /item/vote which can either be false meaning that a user has not voted for a specific item or true meaning that he has voted.I am currently struggling to select one out of multiple possible designs:HTTP status codesPUT /item/vote => set to trueDELETE /item/vote => set to falseGET /item/vote => status code 204 => true | status code 404 => falseJSONPUT /item/vote HTTP/1.1Content-Type: application/json{    vote: true}GET /item/vote HTTP/1.1HTTP/1.1 200 OKContent-Type: application/json{    vote: true}Is any of these two approaches better or is it just a matter of preference? I am currently preferring the HTTP status code approach because I have already seen it.
Boolean endpoint within a RESTful API
design;rest;api design
The second approach is highly preferable. PUT is intended to replace the resource on the server with the content you're PUTting. Likewise, DELETE is intended to delete a resource, not to set its value.