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 JanLehnardt
Date Thu, 26 Feb 2009 09:53:41 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 JanLehnardt:
http://wiki.apache.org/couchdb/HTTP_Document_API

The comment on the change is:
document attachments=true option

------------------------------------------------------------------------------
  === Inline Attachments ===
  On creation, attachments go into a special ''_attachments'' attribute of the document. They
are encoded in a JSON structure that holds the name, the content_type and the base64 encoded
data of an attachment. A document can have any number of attachments.
  
- When retrieving documents, the attachment's actual data is not included, only the metadata.
The actual data has to be fetched separately, using a special URI.
+ When retrieving documents, the attachment's actual data is not included, only the metadata.
The actual data has to be fetched separately, using a special URI. 
+ 
+ If you need to access attachments with the document in one request, you can pass in the
`?attachments=true` URL parameter to get the data included in the JSON in the base64 encoded
form. Since this puts a significant burden on CouchDB when you request this, you're not advised
to use this feature unless you know what you are doing :)
  
  Creating a document with an attachment:
  

Mime
View raw message