couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Couchdb Wiki] Update of "HTTP Document API" by mdornseif
Date Thu, 25 Dec 2008 22:31:35 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The following page has been changed by mdornseif:
http://wiki.apache.org/couchdb/HTTP_Document_API

The comment on the change is:
removed client-side Date: headers following RfC 2616 #14.18 suggestion

------------------------------------------------------------------------------
  
  {{{
  GET somedatabase/_all_docs HTTP/1.0
- Date: Thu, 17 Aug 2006 05:39:28 +0000GMT
  }}}
  
  Will return a listing of all documents and their revision IDs, ordered by DocID (case sensitive):
@@ -109, +108 @@

  
  {{{
  GET somedatabase/_all_docs?startkey=doc2&count=2 HTTP/1.0
- Date: Thu, 17 Aug 2006 05:39:28 +0000GMT
  }}}
  
  Will return:
@@ -140, +138 @@

  
  {{{
  GET somedatabase/_all_docs?startkey=doc2&count=2&descending=true HTTP/1.0
- Date: Thu, 17 Aug 2006 05:39:28 +0000GMT
  }}}
  
  Will return:
@@ -167, +164 @@

  
  {{{
  GET /somedatabase/some_doc_id HTTP/1.0
- Date: Thu, 17 Aug 2006 05:39:28 +0000GMT
  }}}
  
  Here is the server's response:
@@ -197, +193 @@

  
  {{{
  GET /somedatabase/some_doc_id?rev=946B7D1C HTTP/1.0
- Date: Thu, 17 Aug 2006 05:39:28 +0000GMT
  }}}
  
  To find out what revisions are available for a document, you can do:
  
  {{{
  GET /somedatabase/some_doc_id?revs=true HTTP/1.0
- Date: Thu, 17 Aug 2006 05:39:28 +0000GMT
  }}}
  
  This returns the current revision of the document, but with an additional field, ''_revs'',
the value being a list of the available revision IDs. Note though that not every of those
revisions of the document is necessarily still stored on disk. For example, the content of
an old revision may get removed by compacting the database, or it may only exist in a different
database if it was replicated.
@@ -232, +226 @@

  {{{
  PUT /somedatabase/some_doc_id HTTP/1.0
  Content-Length: 245
- Date: Thu, 17 Aug 2006 05:39:28 +0000GMT
  Content-Type: application/json
  
  {
@@ -264, +257 @@

  {{{
  PUT /somedatabase/some_doc_id HTTP/1.0
  Content-Length: 245
- Date: Thu, 17 Aug 2006 05:39:28 +0000GMT
  Content-Type: application/json
  
  {
@@ -309, +301 @@

  {{{
  POST /somedatabase/ HTTP/1.0
  Content-Length: 245
- Date: Thu, 17 Aug 2006 05:39:28 +0000GMT
  Content-Type: application/json
  
  {
@@ -383, +374 @@

  
  {{{
  DELETE /somedatabase/some_doc?rev=1582603387 HTTP/1.0
- Date: Thu, 17 Aug 2006 05:39:28 +0000GMT
  }}}
  
  As an alternative you can submit the ''rev'' parameter with the etag header field ''If-Match''.
  {{{
  DELETE /somedatabase/some_doc HTTP/1.0
- Date: Thu, 17 Aug 2006 05:39:28 +0000GMT
  If-Match: "1582603387"
  }}}
  

Mime
View raw message