@@ -610,6 +610,8 @@ def post(self, path_segment, owner=None, app=None, sharing=None, headers=None, *
610610 :type app: ``string``
611611 :param sharing: The sharing mode of the namespace (optional).
612612 :type sharing: ``string``
613+ :param headers: List of extra HTTP headers to send (optional).
614+ :type headers: ``list`` of 2-tuples.
613615 :param query: All other keyword arguments, which are used as query
614616 parameters.
615617 :type query: ``string``
@@ -644,13 +646,7 @@ def post(self, path_segment, owner=None, app=None, sharing=None, headers=None, *
644646 path = self .authority + self ._abspath (path_segment , owner = owner ,
645647 app = app , sharing = sharing )
646648 logging .debug ("POST request to %s (body: %s)" , path , repr (query ))
647- if isinstance (headers , dict ):
648- all_headers = [(k ,v ) for k ,v in headers .iteritems ()]
649- elif isinstance (headers , list ):
650- all_headers = headers
651- else :
652- raise ValueError ("headers must be a list or dict (found: %s)" % headers )
653- all_headers += self ._auth_headers
649+ all_headers = headers + self ._auth_headers
654650 response = self .http .post (path , all_headers , ** query )
655651 return response
656652
@@ -673,6 +669,12 @@ def request(self, path_segment, method="GET", headers=None, body="",
673669 *path_segment*.
674670 :param path_segment: A REST path segment.
675671 :type path_segment: ``string``
672+ :param method: The HTTP method to use (optional).
673+ :type method: ``string``
674+ :param headers: List of extra HTTP headers to send (optional).
675+ :type headers: ``list`` of 2-tuples.
676+ :param body: Content of the HTTP request (optional).
677+ :type body: ``string``
676678 :param owner: The owner context of the namespace (optional).
677679 :type owner: ``string``
678680 :param app: The app context of the namespace (optional).
0 commit comments