[tor-dev] [OONI] Designing the OONI Backend (OONIB). RESTful API vs rsynch

Tom Ritter tom at ritter.vg
Sun Jul 15 14:13:45 UTC 2012


> Contra:
> * No support for deltas (we can use rsych protocol over HTTP if we
> really need this).

It's a little hackish, but I believe there is a 'standard' way to do
this in HTTP also.  A client issues a GET (or PUT) request to a
resource, and recieves an Etag that identifies this version of the
object.  The client then issues a PATCH Request to update the object,
sending the Etag, and either structured XMLor JSON with the fields to
replace, or binary data with a Range header indicating where in the
object to replace.

If the Etag the client sent is the object stored on the server, the
PATCH succeeds and overwrites the data. If the Etag does not match,
the client is out of date and must issue a GET, resolve differences,
and then the PATCH.

-tom


More information about the tor-dev mailing list