Closed mgmarino closed 10 years ago
I have opted for a slightly less intrusive fix to this issue, namely simply to not overwrite 'data' if both 'data' and 'params' are passed in on a post/put method. This solution doesn't break previous functionality, but still allows querying views using the post-to-view method.
Already merged.
It is possible to do a multi-key fetch to a view using post, e.g.:
In principle, post to view can also take query parameters (e.g. reduce=false, etc.), but trying to call this as expected:
results in them not being used. This is because Resource._make_request appends the params to data so that they appear in the posted data (and not as query parameters), but these are not recognized by couchdb and so are ignored. (This may or may not be a bug in couchdb.)
A work around is:
but I think this is not ideal.
I'm not sure the best solution to this problem, but I believe it may be to remove the special handling of 'post' and 'put' in
_make_request
. That is, this would allow for query params to be sent in addition to data instead of lumping them all together. (Is there a part of the CouchDB API that requires this? I would suggest it should be up to the user to specify what gets submitted as a parameter and what in the body.)