On Fri, Jan 2, 2009 at 4:10 PM, Matt Goodall <[email protected]> wrote: > 2009/1/2 Jason Davies <[email protected]>: >> >> On 2 Jan 2009, at 16:11, Paul Davis wrote: >> >>> Also, as a random aside, why does _uuids require a POST? >>
In the normal case you would POST a document to a collection when you want the server to choose the final URL. However, intermediaries have a habit of retrying POSTs randomly, so when you POST and id-less Couch document, occasionally duplicate documents are created. We work around this by recommending PUT as the document creation method. Of course clients can specify any document id they'd like to, but for lightweight clients CouchDB provides the _uuids service. The POST is pragmatic for cache-control reasons, but also RESTy, because it exposes the service that CouchDB uses internally for directing document POSTs to new ids. By using the _uuids service, clients can become the part of CouchDB that would direct documents to URLs in a collection. -- Chris Anderson http://jchris.mfdz.com
