On 2 Aug 2009, at 10:32, Paul Joseph Davis wrote:

On Aug 2, 2009, at 5:10 AM, "Jason Davies (JIRA)" <[email protected]> wrote:


[ https://issues.apache.org/jira/browse/COUCHDB-441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12738023 #action_12738023 ]

Jason Davies commented on COUCHDB-441:
--------------------------------------

Nice work Paul! One thing I noticed about your patch is that _update expects a JSON body in the request. Can we remove this requirement and make it so the function signature is simply (doc, req, userCtx)? In my oauth branch I've modified couch_httpd_external.erl to always populate req.userCtx so the function signature will be even shorter when this gets merged.

Then we can do fun things like handle XML bodies in the request.


Had not contemplated that. If we go that direction then we'll probably want to not have the docid in the URL as well. I'm not opposed so what ever general consensus is is fine with me.


You mean we could go all procedural and have something like saveDoc(arbitraryDoc)? I think having the docid in the URL makes _update analagous to _show, I'm not sure how else you would know where to load the doc from without defining something like saveDoc(...), which could potentially break the whole one-doc-affected per update request restriction that we have currently for _update.

I would probably stick with the docid in the URL for now, but if we decide to go down the road of having saveDoc(), getDoc(), getView() etc. functions then that's something to discuss in another thread (BenoƮt Chesneau has already proposed this on the couchapp mailing list).

--
Jason Davies

www.jasondavies.com

Reply via email to