TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Patterns for REST API bulk operations

2 pointsby l1ghtm4nalmost 12 years ago

1 comment

ratpikalmost 12 years ago
HTTP PATCH is a very good way to do RESTful bulk operations<p>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&#x2F;server.<p>Eg.<p>curl --dump-header - -H &quot;Content-Type: application&#x2F;json&quot; -X PATCH --data &#x27;{&quot;objects&quot;: [{&quot;body&quot;: &quot;Surprise! Another post!.&quot;, &quot;pub_date&quot;: &quot;2012-02-16T00:46:38&quot;, &quot;slug&quot;: &quot;yet-another-post&quot;, &quot;title&quot;: &quot;Yet Another Post&quot;}], &quot;deleted_objects&quot;: [&quot;<a href="http:&#x2F;&#x2F;localhost:8000&#x2F;api&#x2F;v1&#x2F;entry&#x2F;4&#x2F;&quot;]}&#x27;" rel="nofollow">http:&#x2F;&#x2F;localhost:8000&#x2F;api&#x2F;v1&#x2F;entry&#x2F;4&#x2F;&quot;]}&#x27;</a> <a href="http:&#x2F;&#x2F;localhost:8000&#x2F;api&#x2F;v1&#x2F;entry&#x2F;" rel="nofollow">http:&#x2F;&#x2F;localhost:8000&#x2F;api&#x2F;v1&#x2F;entry&#x2F;</a>
评论 #5901644 未加载