Skip to content
matteosister edited this page Dec 3, 2014 · 15 revisions

Next (How it works) ►

This library is inspired by a blog post by William Durand. Head over to his blog to read the long story...

TL;DR

The patch method is often misunderstood, and not used very often. This library tries to set a standard to handle patch operations.

For example:

PATCH /users/1

{ "op": "data", "property": "username", "value": "new username" }

or:

PATCH /books/1

[
  { "op": "data", "property": "title", "value": "1986" },
  { "op": "publish" }
]

or even patch an entire collection:

PATCH /books

{ "op": "set_as_read" }

how expressive! Now some insight...

Next (How it works) ►