On Wed, Sep 14, 2011 at 13:55, Jens Alfke <[email protected]> wrote:
> > On Sep 14, 2011, at September 14, 201112:19 PM, Adam Kocoloski wrote: > > There's a multipart API which allows for a single PUT request containing > the document body as JSON and all its attachments in their raw form. > Documentation is pretty thin at the moment, and unfortunately I think it > doesn't quite allow for a pipe(). Would be really nice if it did, though. > > Any tips on how to invoke this? It would be very useful in the framework > I’m working on. > I just checked <http://wiki.apache.org/couchdb/HTTP_Document_API> and > there’s nothing about it. > Check out the lines in mikeal replicator I linked to. It should give you some hints. I think it's PUT with Content-Type: multipart/related and then you just send the body followed by the attachments. I think you need to have an _attachments object in the body and for each attachment specify content_type, length, and follows: true. > > —Jens >
