Solution for Is it OK to skip endpoints that I don’t need or it’s considered a bad practice?
is Given Below:
For example, User can only vote ( once a day ), see his vote, modify it and see history of votes.
How can this be implemented using REST?
localhost/vote – GET – get vote history
localhost/vote/id – GET – get current vote ( there can’t be more than one, so having to write ID looks comically )
localhost/vote – POST- create new vote ( What to do if user has already voted? )
localhost/vote/id – PUT – update it ( Again ID )
Delete endpoint will be skipped.
The app needs to have only the relevant endpoint that it needs.
If DELETE is not relevant, so no delete endpoint.
There is nothing bad with it.