database - In simple RESTful design, does PATCH imply mapping to CRUD's (ORM's) "update" and PUT to "destroy"+"create" (to replace a resource)? -
i'm trying create simple rest api , map crud. have orm (datamapper) has methods create
, update
, destroy
.
if right, given resource {a:'foo',b:'bar',c:'baz'}
, performing put {b:'qux'}
supposed replace resource , result in same {b:'qux'}
, , doing patch {b:'qux'}
should result in {a:'foo',b:'qux',c:'baz'}
.
would put
implemented orm's destroy
+create
recreate database record (with same old id) or both put
, patch
mapped update
(and record's fields manipulated)?
well, both actions means update, put full update , patch partial update. in case of put know identifier of resource , resource exists, not create , delete action per se. infact, can make providing put action resource. idiosyncrasy of put client supposed provide full representation of resource. since request put, must come after of resource, providing full representation shouldn't problem client anyway.
Comments
Post a Comment