Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 20507 invoked from network); 16 Feb 2011 18:16:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Feb 2011 18:16:21 -0000 Received: (qmail 16212 invoked by uid 500); 16 Feb 2011 18:16:19 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 15939 invoked by uid 500); 16 Feb 2011 18:16:17 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 15931 invoked by uid 99); 16 Feb 2011 18:16:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Feb 2011 18:16:16 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jwalgran@azavea.com designates 209.85.215.52 as permitted sender) Received: from [209.85.215.52] (HELO mail-ew0-f52.google.com) (209.85.215.52) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Feb 2011 18:16:10 +0000 Received: by ewy23 with SMTP id 23so566839ewy.11 for ; Wed, 16 Feb 2011 10:15:49 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.73.202 with SMTP id r10mr1179974faj.133.1297880143763; Wed, 16 Feb 2011 10:15:43 -0800 (PST) Received: by 10.223.102.130 with HTTP; Wed, 16 Feb 2011 10:15:43 -0800 (PST) Date: Wed, 16 Feb 2011 13:15:43 -0500 Message-ID: Subject: Downloading CSV from the browser by POSTing keys to a list? From: Justin Walgran To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 I have a list function that returns a group of documents as a CSV file. I am feeding this list function with a view, which I am filtering by passing an array of keys in a JSON object in the body of a POST request. I can POST to the list and get the correct response using curl. So far so good. Is it possible to trigger this post when a user clicks a 'Download CSV' link on my html page? I can't use $.post because the data is returned to a callback and I need the data and headers to go to the browser. Googling for this results in suggestions that I add an invisible form to the DOM and post that, but I don't believe this will POST the JSON body in the way Couch expects. Any suggestions on how I can make this work? Thanks, Justin