apache / apache/couchdb

Document Creating Multiple Attachments Using A Web Browser

Open
#4,648 1 comment 0 reactions 0 assignees View on GitHub
enhancement needs-triage
Dominant language
Erlang
Stars
7k
Forks
1.1k
Avg merge
1d 16h
Merged PRs (30d)
9

Description

[NOTE]: # ( ^^ Provide a general summary of the request in the title above. ^^ )

## Summary

[The documentation](https://docs.couchdb.org/en/stable/api/document/common.html#creating-multiple-attachments) shows that it is possible to load multiple attachments in a single HTTP PUT, the `Content-Type` being `multipart/related`. Web browser methods XMLHTTPRequest and Fetch do not natively produce HTTP requests with this `Content-Type`.

## Desired Behaviour

Publish JavaScript illustrating how to PUT multiple attachments in a single request to CouchDB.

NOTE: I tried to proxy a request crafted with `FormData()` through Node.js and simply rewrite the `Content-Type` (keeping the `boundary`) but this fails with a `500` error.

Contributor guide

Open the contributing guide

Research direction

Start with the existing “Creating multiple attachments” documentation section and review the multipart/related requirements described there, then compare them with browser XMLHttpRequest, Fetch, and FormData behavior. Done means the CouchDB documentation includes a working JavaScript browser example for PUTting multiple attachments and explains the required request format.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.