You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2021/08/17 21:08:19 UTC
[GitHub] [couchdb-documentation] nickva edited a comment on pull request #674: Fix allowed method for ddoc update function
nickva edited a comment on pull request #674:
URL: https://github.com/apache/couchdb-documentation/pull/674#issuecomment-900463236
`POST` is typically to create a subordinate sub-resource. So `POST` to `$db` with with a doc body would create a new document (sub-resource) in that $db.
`PUT` is to update an existing resource by specifying its full path. `PUT` to `$db/$doc_id` should update that $doc_id somehow, possibly replace it.
From https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
> The posted entity is subordinate to that URI in the same way that a file is subordinate to a directory containing it, a news article is subordinate to a newsgroup to which it is posted, or a record is subordinate to a database.
> The fundamental difference between the POST and PUT requests is reflected in the different meaning of the Request-URI. The URI in a POST request identifies the resource that will handle the enclosed entity. That resource might be a data-accepting process, a gateway to some other protocol, or a separate entity that accepts annotations. In contrast, the URI in a PUT request identifies the entity enclosed with the request -- the user agent knows what URI is intended and the server MUST NOT attempt to apply the request to some other resource. If the server desires that the request be applied to a different URI,
Could _update handlers also get PATCH or DELETE methods. Say if _updater handler removes the document?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org