On Fri, Feb 27, 2009 at 07:44:36AM +0000, Brian Candler wrote: > The canonical reference is RFC 2046 section 5.1. Also see RFC 2387 for > multipart/related, which is probably what CouchDB will want to use. > > It's actually pretty simple, as you can see by looking at some lightweight > MIME implementations which handle only multipart, e.g. > http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/lib/soap/mimemessage.rb?view=markup
And here's a really tiny one (just for multipart HTTP POSTs) http://www.realityforge.org/articles/2006/03/02/upload-a-file-via-post-with-net-http A couple of knock-on effects to consider: - You could allow the option of using multipart/mixed when doing a multi-document fetch (or even a view). Then when this is combined with attachments=true, each doc would be a multipart/related nested within a multipart/mixed wrapper. A bit unusual, but perfectly legal. - You won't want to calculate an up-front Content-Length: for all this, so probably best to use chunked transfer encoding. Regards, Brian.
