Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B42624A44 for ; Wed, 13 Jul 2011 12:04:28 +0000 (UTC) Received: (qmail 12375 invoked by uid 500); 13 Jul 2011 12:04:26 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 12177 invoked by uid 500); 13 Jul 2011 12:04:25 -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 12104 invoked by uid 99); 13 Jul 2011 12:04:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jul 2011 12:04:24 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=NORMAL_HTTP_TO_IP,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [200.243.80.130] (HELO mail.loop.com.br) (200.243.80.130) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 13 Jul 2011 12:04:17 +0000 Received: (qmail 16970 invoked by uid 64014); 13 Jul 2011 09:03:52 -0300 Received: from 172.17.2.106 (mike@loop.com.br@172.17.2.106) by intranet (envelope-from , uid 64011) with qmail-scanner-2.01st (clamdscan: 0.88/1633. spamassassin: 3.0.3. perlscan: 2.01st. Clear:RC:1(172.17.2.106):. Processed in 0.023087 secs); 13 Jul 2011 12:03:52 -0000 Received: from unknown (HELO ?172.17.2.106?) (mike@loop.com.br@172.17.2.106) by 172.17.3.17 with SMTP; 13 Jul 2011 09:03:52 -0300 Subject: Re: Unexpected response for ?open_revs=all From: Mike Leddy To: user@couchdb.apache.org Date: Wed, 13 Jul 2011 09:03:52 -0300 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.0.0- Content-Transfer-Encoding: 8bit Message-ID: <1310558632.4327.8.camel@mike.loop.com.br> Mime-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Hi Jens, You can get the behaviour you want if you can set the Accept header in the http request ie: $ curl -i -H 'Accept: application/json' 'http://127.0.0.1:5984/test/one?open_revs=all' HTTP/1.1 200 OK Transfer-Encoding: chunked Server: CouchDB/1.2.0a-0e1af07-git (Erlang OTP/R14B03) Date: Wed, 13 Jul 2011 12:00:23 GMT Content-Type: application/json Cache-Control: must-revalidate [{"ok":{"_id":"one","_rev":"2-7051cbe5c8faecd085a3fa619e6e6337"}}] As opposed to: $ curl -i 'http://127.0.0.1:5984/test/one?open_revs=all' HTTP/1.1 200 OK Transfer-Encoding: chunked Server: CouchDB/1.2.0a-0e1af07-git (Erlang OTP/R14B03) Date: Wed, 13 Jul 2011 12:02:19 GMT Content-Type: multipart/mixed; boundary="2d29ffaa2362c73c3c22a9d434aa8859" --2d29ffaa2362c73c3c22a9d434aa8859 Content-Type: application/json {"_id":"one","_rev":"2-7051cbe5c8faecd085a3fa619e6e6337"} --2d29ffaa2362c73c3c22a9d434aa8859-- Regards, Mike On Tue, 2011-07-12 at 18:38 -0700, Jens Alfke wrote: > I’m trying to get a list of conflicting revisions by using the “?open_revs=all” query parameter, as described in the conflict documentation in the wiki[1]. But when I test this with curl, the output is completely unexpected — instead of a JSON array as documented, I get a MIME multipart body. What’s going on? > > In this example the document isn’t actually in conflict, as I haven’t synthesized a conflict in my test database yet (though I will soon thanks to Paul’s handy Python script!) > > $ curl -i 'http://127.0.0.1:5984/db/3aaa5e74e5d96db3b2248fb1c404eb65?open_revs=all’ > HTTP/1.1 200 OK > Transfer-Encoding: chunked > Server: CouchDB/1.2.0a-eb77a97-git (Erlang OTP/R14B01) > Date: Wed, 13 Jul 2011 01:16:36 GMT > Content-Type: multipart/mixed; boundary="5316aac5e82bfd1b98ba15d212819f24" > > --5316aac5e82bfd1b98ba15d212819f24 > Content-Type: application/json > > {"_id":"3aaa5e74e5d96db3b2248fb1c404eb65","_rev":"7-7e833e1c2ee3db8e4ae3f615c20ca592","first":"Jens","last":"Alfke","email":"jens@mooseyard.com"} > --5316aac5e82bfd1b98ba15d212819f24— > > —Jens > > [1] http://wiki.apache.org/couchdb/Replication_and_conflicts