rest - RESTful Soft Delete -
i'm trying build restful webapp wherein utilize get, post, put, , delete. had question use of delete in particular app.
a bit of background first:
my webapp manages generic entities managed (and, happens, created) in system. within webapp, each entity stored in database unique key. way accessing them through urls unique key of other system.
a simple example make clear, think. take url /entity/1
. display information entity id 1 in other system, , not own system. in fact, ids in system hidden. there no url scheme accessing entity id of 1
in own system.
alright, know how webapp structured, let's return deleting entities.
there way 'delete' entities in system, put quotes around because won't deleting them database. rather, flag them property prevents appearing when go /entity/1
.
because of this, feel should using put
('deleting' in way idempotent), since am, perspective of data, setting property.
so, question: restful approach have fidelity data (in case clear put
ing), or representation of data in app (in case seems delete
ing)?
you should use delete
.
what intend data called "soft deleting": set flag , avoid flagged items appearing. internal webapp , user doesn't have know you're soft deleting instead of deleting or whatever want do. why should use delete
verb.
Comments
Post a Comment