Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 13078 invoked from network); 9 Oct 2010 01:20:14 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Oct 2010 01:20:14 -0000 Received: (qmail 77154 invoked by uid 500); 9 Oct 2010 01:19:43 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 77102 invoked by uid 500); 9 Oct 2010 01:19:43 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 77071 invoked by uid 99); 9 Oct 2010 01:19:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Oct 2010 01:19:43 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED,NORMAL_HTTP_TO_IP,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Oct 2010 01:19:43 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o991JMhw003521 for ; Sat, 9 Oct 2010 01:19:23 GMT Message-ID: <28339873.50761286587162969.JavaMail.jira@thor> Date: Fri, 8 Oct 2010 21:19:22 -0400 (EDT) From: "Paul Joseph Davis (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Updated: (COUCHDB-642) Support rev in PUT URL In-Reply-To: <1162170003.123021265646387919.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-642?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Paul Joseph Davis updated COUCHDB-642: -------------------------------------- Skill Level: New Contributors Level (Easy) > Support rev in PUT URL > ---------------------- > > Key: COUCHDB-642 > URL: https://issues.apache.org/jira/browse/COUCHDB-642 > Project: CouchDB > Issue Type: New Feature > Components: HTTP Interface > Environment: trunk 08 Feb 2010 > Reporter: Brian Candler > Priority: Minor > Attachments: 0001-Allow-for-the-current-revision-number-to-be.patch > > > A DELETE request lets you append ?rev=xxxx to the URL. But this doesn't work with a PUT request; you have to put the _rev in the body instead (even though the _id is taken from the URL path) > $ curl -X PUT -d "{}" http://brianadmin:brianadmin@127.0.0.1:5984/briantest/foo > {"ok":true,"id":"foo","rev":"1-967a00dff5e02add41819138abb3284d"} > $ curl -X PUT -d "{}" http://brianadmin:brianadmin@127.0.0.1:5984/briantest/foo?rev=1-967a00dff5e02add41819138abb3284d > {"error":"conflict","reason":"Document update conflict."} > $ curl -X PUT -d '{"_rev":"1-967a00dff5e02add41819138abb3284d"}' http://brianadmin:brianadmin@127.0.0.1:5984/briantest/foo > {"ok":true,"id":"foo","rev":"2-7051cbe5c8faecd085a3fa619e6e6337"} > Allowing ?rev in the URL would make PUT and DELETE more consistent, and would allow you to replace an existing JSON doc with another one without having to merge the _rev into it first. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.