[jifty-devel] Jifty REST and PATCH
Piers Cawley
pdcawley at bofh.org.uk
Fri Feb 22 13:10:25 EST 2008
On Thu, Feb 21, 2008 at 7:47 PM, Jesse Vincent <jesse at bestpractical.com> wrote:
> http://bitworking.org/news/298/Considering-PATCH
>
> Should we support PATCH? What would it look like?
>
> Thoughts, comments?
My gut feeling in this has been to consider representing the various
fields in a resource as sub resources, possibly with url templates to
allow for atomically changing multiple fields. So, say there's your
typical blog post which has fields like is_published, title, body,
excerpt, these would be accessed individually as, say:
/2008/02/22/to-patch-or-not-to-patch/fields/body
/2008/02/22/to-patch-or-not-to-patch/fields/is_published;title
These would be dealt with via the usual REST semantics, and would be
available in the usual representations. Given that basic framework of
subresources, a full on PATCH would hopefully be less necessary.
However, where it makes sense, I'd think about supporting patch with
something like:
PATCH /2008/02/22/to-patch-or-not-to-patch/fields/body.textile
Host: whatever
Content-Type: text/x-unified-diff
<unified diff for the body element>
However, I'm shooting from the hip here...
More information about the jifty-devel
mailing list