Adding an attachment with Sync Gateway REST API


Moving this to the Sync Gateway category…

From what the REST API documentation says, the URL to post to should look a bit like this:
PUT /cookbook/LemonChicken/lcnote.txt?rev=1-78abf9a6508671ba8338e4ef6daa910a HTTP/1.1
yours looks something like this…
PUT /sync_srucc/9ef40c1d-dfac-4e41-a987-a23ckk25bc3198?=/tablet.png HTTP/1.1

Note the first one is an attachment to the document LemonChicken and is behind a slash, while yours seems to be an item itself.

Continuing the discussion from How to add attachments?:

How to add attachments?

awesome - that was it…somehow this got added to the end of the document guid “?=”…thx for all your help!


Any idea how to PUT an image attachment using the REST API? How does it need to be encoded? I’m using fetch.