You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Robert Schonberger <rs...@gmail.com> on 2009/03/05 22:14:55 UTC

Slight inconsistency in the wiki information—409 vs. 412 response

Hi all,i'm reading through the couchdb wiki, and looking at
http://wiki.apache.org/couchdb/HTTP_Document_API

notably, in the section about uploading documents via PUT, there is a
comment:
To update an existing document, you also issue a *PUT* request. In this
case, the JSON body must contain a *_rev* property, which lets CouchDB know
which revision the edits are based on. If the revision of the document
currently stored in the database doesn't match, then a *409* conflict error
is returned.

and looking at the response example :

HTTP/1.1 412 Precondition Failed
Date: Thu, 17 Aug 2006 05:39:28 +0000GMT
Content-Length: 33
Connection: close

{"error":"conflict","reason":"Document update conflict."}

I'm just wondering which of the 2 of 409 or 412 it is. I don't think it's
supremely important, just something I noticed!

(First post to user@)
Rob

-- 
Robert Schonberger
rschonberger@gmail.com

Re: Slight inconsistency in the wiki information—409 vs. 412 response

Posted by Robert Schonberger <rs...@gmail.com>.
Done! :)

2009/3/6 Paul Davis <pa...@gmail.com>

> Rob,
>
> The return codes from trying to create an already existing DB and
> trying to update a doc with no or an incorrect _rev were once what's
> in the wiki. IIRC, someone brought it up and it was decided that
> should be swapped. Feel free to correct the wiki.
>
> HTH,
> Paul Davis
>
> On Thu, Mar 5, 2009 at 4:14 PM, Robert Schonberger
> <rs...@gmail.com> wrote:
> > Hi all,i'm reading through the couchdb wiki, and looking at
> > http://wiki.apache.org/couchdb/HTTP_Document_API
> >
> > notably, in the section about uploading documents via PUT, there is a
> > comment:
> > To update an existing document, you also issue a *PUT* request. In this
> > case, the JSON body must contain a *_rev* property, which lets CouchDB
> know
> > which revision the edits are based on. If the revision of the document
> > currently stored in the database doesn't match, then a *409* conflict
> error
> > is returned.
> >
> > and looking at the response example :
> >
> > HTTP/1.1 412 Precondition Failed
> > Date: Thu, 17 Aug 2006 05:39:28 +0000GMT
> > Content-Length: 33
> > Connection: close
> >
> > {"error":"conflict","reason":"Document update conflict."}
> >
> > I'm just wondering which of the 2 of 409 or 412 it is. I don't think it's
> > supremely important, just something I noticed!
> >
> > (First post to user@)
> > Rob
> >
> > --
> > Robert Schonberger
> > rschonberger@gmail.com
> >
>



-- 
Robert Schonberger
rschonberger@gmail.com

Re: Slight inconsistency in the wiki information—409 vs. 412 response

Posted by Paul Davis <pa...@gmail.com>.
Rob,

The return codes from trying to create an already existing DB and
trying to update a doc with no or an incorrect _rev were once what's
in the wiki. IIRC, someone brought it up and it was decided that
should be swapped. Feel free to correct the wiki.

HTH,
Paul Davis

On Thu, Mar 5, 2009 at 4:14 PM, Robert Schonberger
<rs...@gmail.com> wrote:
> Hi all,i'm reading through the couchdb wiki, and looking at
> http://wiki.apache.org/couchdb/HTTP_Document_API
>
> notably, in the section about uploading documents via PUT, there is a
> comment:
> To update an existing document, you also issue a *PUT* request. In this
> case, the JSON body must contain a *_rev* property, which lets CouchDB know
> which revision the edits are based on. If the revision of the document
> currently stored in the database doesn't match, then a *409* conflict error
> is returned.
>
> and looking at the response example :
>
> HTTP/1.1 412 Precondition Failed
> Date: Thu, 17 Aug 2006 05:39:28 +0000GMT
> Content-Length: 33
> Connection: close
>
> {"error":"conflict","reason":"Document update conflict."}
>
> I'm just wondering which of the 2 of 409 or 412 it is. I don't think it's
> supremely important, just something I noticed!
>
> (First post to user@)
> Rob
>
> --
> Robert Schonberger
> rschonberger@gmail.com
>