Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9792D1067A for ; Sun, 10 Nov 2013 13:10:46 +0000 (UTC) Received: (qmail 42905 invoked by uid 500); 10 Nov 2013 13:10:45 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 42777 invoked by uid 500); 10 Nov 2013 13:10:40 -0000 Mailing-List: contact commits-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 commits@couchdb.apache.org Received: (qmail 42767 invoked by uid 99); 10 Nov 2013 13:10:39 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Nov 2013 13:10:39 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 5F9808213E5; Sun, 10 Nov 2013 13:10:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: andywenk@apache.org To: commits@couchdb.apache.org Message-Id: <4b677f893ab5406d8d053ee07c5e069e@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/1924-add-an-example-for-updating-a-document-with-PUT to 50e1fae Date: Sun, 10 Nov 2013 13:10:39 +0000 (UTC) Updated Branches: refs/heads/1924-add-an-example-for-updating-a-document-with-PUT 3b6301fe3 -> 50e1faed5 Instead of inserting the request / response example for updating a document with put in the section PUT /{db}/{docid} add a note with a link to the section "Updating an existing Document" Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/50e1faed Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/50e1faed Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/50e1faed Branch: refs/heads/1924-add-an-example-for-updating-a-document-with-PUT Commit: 50e1faed5dad2797883c6722b8d9ec3e61fae3cf Parents: 3b6301f Author: Andy Wenk Authored: Sun Nov 10 14:08:50 2013 +0100 Committer: Andy Wenk Committed: Sun Nov 10 14:08:50 2013 +0100 ---------------------------------------------------------------------- share/doc/src/api/document/common.rst | 65 ++---------------------------- 1 file changed, 3 insertions(+), 62 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/50e1faed/share/doc/src/api/document/common.rst ---------------------------------------------------------------------- diff --git a/share/doc/src/api/document/common.rst b/share/doc/src/api/document/common.rst index 5734f07..7423227 100644 --- a/share/doc/src/api/document/common.rst +++ b/share/doc/src/api/document/common.rst @@ -235,68 +235,8 @@ "rev": "1-917fa2381192822767f010b95b45325b" } - **Request (update existing document)**: - - .. code-block:: http - - PUT /recipes/SpaghettiWithMeatballs?rev=1-917fa2381192822767f010b95b45325b HTTP/1.1 - Accept: application/json - Content-Length: 196 - Content-Type: application/json - Host: localhost:5984 - - { - "description": "An Italian-American dish that usually consists of spaghetti, tomato sauce and meatballs.", - "ingredients": [ - "spaghetti", - "tomato sauce", - "meatballs", - "mozarella" - ], - "name": "Spaghetti with meatballs" - } - - Alternatively, instead of the ``rev`` query parameter you may use the - :header:`If-Match` header: - - .. code-block:: http - - PUT /recipes/SpaghettiWithMeatballs HTTP/1.1 - Accept: application/json - Content-Length: 196 - Content-Type: application/json - If-Match: 1-917fa2381192822767f010b95b45325b - Host: localhost:5984 - - { - "description": "An Italian-American dish that usually consists of spaghetti, tomato sauce and meatballs.", - "ingredients": [ - "spaghetti", - "tomato sauce", - "meatballs", - "mozarella" - ], - "name": "Spaghetti with meatballs" - } - - **Response (update existing document)**: - - .. code-block:: http - - HTTP/1.1 201 Created - Cache-Control: must-revalidate - Content-Length: 85 - Content-Type: application/json - Date: Wed, 14 Aug 2013 20:34:23 GMT - ETag: 2-faf1e73a94ff04ebede600f173ca0412 - Location: http://localhost:5984/recipes/SpaghettiWithMeatballs - Server: CouchDB (Erlang/OTP) - - { - "id": "SpaghettiWithMeatballs", - "ok": true, - "rev": "2-faf1e73a94ff04ebede600f173ca0412" - } + .. note:: + For updating an existing document please see :ref:`Updating an Existing Document` below. .. http:delete:: /{db}/{docid} @@ -1095,6 +1035,7 @@ with :get:`/{db}/{docid}` request: "_rev": "2-056f5f44046ecafc08a2bc2b9c229e20" } +.. _Updating an Existing Document: Updating an Existing Document -----------------------------