

Patterns for REST API bulk operations - l1ghtm4n
http://www.l1ghtm4n.com/post/53259404576/patterns-for-rest-api-bulk-operations

======
ratpik
HTTP PATCH is a very good way to do RESTful bulk operations

I frequently use the PATCH operation to create, update and delete in bulk,
sometimes a combination of these. That is the best bulk operation I have found
till date that is RESTFul and compliant across client/server.

Eg.

curl --dump-header - -H "Content-Type: application/json" -X PATCH --data
'{"objects": [{"body": "Surprise! Another post!.", "pub_date":
"2012-02-16T00:46:38", "slug": "yet-another-post", "title": "Yet Another
Post"}], "deleted_objects":
["[http://localhost:8000/api/v1/entry/4/"]}'](http://localhost:8000/api/v1/entry/4/"\]}')
[http://localhost:8000/api/v1/entry/](http://localhost:8000/api/v1/entry/)

~~~
l1ghtm4n
That is definitely another way to do it. You do lose the significance of the
HTTP verb, though. One reason i've come to the dedign i proposed is that a web
form usually isn't creating and deleting in a single operation, so I used that
to justify different entry points.

