You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by Constantin Teodorescu <br...@gmail.com> on 2016/03/13 22:23:34 UTC

POST to CouchDB from html forms with enctype multipart/form-data ?

*** Short story ***
For the moment, CouchDB POST's to list functions are accepting only
application/json encoding!
Is there a chance to made it accept also data coming from html forms as:
<form method="POST" enctype="multipart/form-data"> ?

*** Long story ***
I was able to do POST's with XMLHttpRequest, everything is OK for
reasonable response sizes.
In my project I have designed a generic list function that do reports that
will do big reports.
I am sending it (through parameters) javascript functions for filtering,
row processing and templates in _ (underscore JavaScript lib) for printing
results.

I am planning to use loading directly through browser's capability of
incrementally receiving chunks of data from CouchDB so I was using for the
begining the GET method. Everything was OK until my parameters send to
function were getting bigger.

I tried to switch to a manual javascripted form that will do a POST to
CouchDB but for the moment, enctype "application/json" is not available,
just: application/x-www-form-urlencoded , multipart/form-data  and
text/plain so I am getting just "bad json"!

I found some discussions about the enctype application/json for sending
forms here: https://www.w3.org/TR/html-json-forms/ but it seems that the
idea was dropped.

So , will CouchDB support in future POST's to list functions directly from
browser's forms with enctype multipart/form-data or x-www-form-urlencoded ?

Thanks for any idea,
Constantin Teodorescu