From dev-return-17992-apmail-couchdb-dev-archive=couchdb.apache.org@couchdb.apache.org Wed Sep 7 23:15:35 2011 Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C56F08B55 for ; Wed, 7 Sep 2011 23:15:32 +0000 (UTC) Received: (qmail 97909 invoked by uid 500); 7 Sep 2011 23:15:32 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 97850 invoked by uid 500); 7 Sep 2011 23:15:31 -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 97835 invoked by uid 99); 7 Sep 2011 23:15:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Sep 2011 23:15:31 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Sep 2011 23:15:29 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 1DFCA87F7D for ; Wed, 7 Sep 2011 23:15:08 +0000 (UTC) Date: Wed, 7 Sep 2011 23:15:08 +0000 (UTC) From: "Randall Leeds (JIRA)" To: dev@couchdb.apache.org Message-ID: <465020223.444.1315437308119.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <534061796.5108.1314835029843.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Assigned] (COUCHDB-1268) "?rev=" URL query parameter MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COUCHDB-1268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Randall Leeds reassigned COUCHDB-1268: -------------------------------------- Assignee: Randall Leeds > "?rev=" URL query parameter > --------------------------- > > Key: COUCHDB-1268 > URL: https://issues.apache.org/jira/browse/COUCHDB-1268 > Project: CouchDB > Issue Type: Improvement > Components: Database Core > Affects Versions: 1.2 > Environment: linux > Reporter: gert cuykens > Assignee: Randall Leeds > Priority: Trivial > Labels: api-change > Original Estimate: 24h > Remaining Estimate: 24h > > When PUTting a document you have to specify the current revision as a _rev key in the JSON; whereas many related requests (like DELETE, COPY and PUT of an attachment) specify the revision in a "?rev=" URL query parameter instead. The first example, will result into a document conflict because rev is not specified in the JSON and the rev from the url gets ignored. All other examples work. I strongly believe JSON bodies like this should never contain _id and _rev and will improve in much better client code. > curl -X PUT http://localhost:5984/_users/user%3Agert?rev=5xxx -H > 'Content-Type: application/json' -d{ > "_id" : "user:gert", > "type" : "user", > "name" : "gert", > "roles" : [], > "password_sha" : "", > "salt" : "" > }' > curl -X PUT http://localhost:5984/_users/user%3Agert -H 'Content-Type: > application/json' -d{ > "_id" : "user:gert", > "_rev":"5xxx", > "type" : "user", > "name" : "gert", > "roles" : [], > "password_sha" : "", > "salt" : "" > }' > curl -X PUT http://localhost:5984/_users/user%3Agert/picture?rev=5xxx > -H 'Content-Type: image/png' -d @picture.png -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira