Skip to content

Commit 687cf12

Browse files
author
Rob Moore
committed
Make Client.update_doc documentation clearer
I was a little thrown off by the documentation here, as there didn't seem to be a way to provide my own request body to the request when calling an update handler; the documentation only indicates that query string params can be given as extra arguments. A little digging into the code shows that options are just passed to the post/put methods intact, so params of those methods can indeed be provided, including path (probably not recommended!), body, and headers. I've updated the documentation accordingly.
1 parent d4a5234 commit 687cf12

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

couchdb/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,10 @@ def update_doc(self, name, docid=None, **options):
10061006
:param name: the name of the update handler function in the format
10071007
``designdoc/updatename``.
10081008
:param docid: optional ID of a document to pass to the update handler.
1009-
:param options: optional query string parameters.
1009+
:param options: additional (optional) params to pass to the underlying
1010+
http resource handler, including ``headers``, ``body``,
1011+
and ```path```. Other arguments will be treated as
1012+
query string params. See :class:`couchdb.http.Resource`
10101013
:return: (headers, body) tuple, where headers is a dict of headers
10111014
returned from the list function and body is a readable
10121015
file-like instance

0 commit comments

Comments
 (0)