On Mon, Feb 23, 2015 at 12:53 AM, Alexander Shorin <[email protected]> wrote:
>> Is it my multipart/mixed response that is wrong? (probably, because it is
>> written by hand, but where is it wrong and how should I be doing this?) or
>> is it something else?
>
> Yes, it is. For documents with attachments in multipart format,
> document object MUST contains an _attachments field with the following
> fields per attachment: content_type, length, but instead of data with
> base64 encoded content, there should be "follows": true field be which
> signs that the attachment content goes in next body parts. See
> http://docs.couchdb.org/en/latest/replication/protocol.html#fetch-changed-documents
> for an example.

More issues:
- content_type couldn't be an empty string
- content_length must be integer
- body field makes no sense, only data is
- if you'd specified data one, no need to send the body part related to it
- but if you uses multipart format, base64 encoded data makes no
sense, so use follows: true and body parts with raw attachments data

--
,,,^..^,,,

Reply via email to