|
@@ -110,7 +110,7 @@ class Resource(object):
|
|
|
return self.invoke("DELETE", relpath, params, headers=headers)
|
|
return self.invoke("DELETE", relpath, params, headers=headers)
|
|
|
|
|
|
|
|
|
|
|
|
|
- def post(self, relpath=None, params=None, data=None, contenttype=None, headers=None, files=None):
|
|
|
|
|
|
|
+ def post(self, relpath=None, params=None, data=None, contenttype=None, headers=None, files=None, allow_redirects=False):
|
|
|
"""
|
|
"""
|
|
|
Invoke the POST method on a resource.
|
|
Invoke the POST method on a resource.
|
|
|
@param relpath: Optional. A relative path to this resource's path.
|
|
@param relpath: Optional. A relative path to this resource's path.
|
|
@@ -118,23 +118,25 @@ class Resource(object):
|
|
|
@param data: Optional. Body of the request.
|
|
@param data: Optional. Body of the request.
|
|
|
@param contenttype: Optional.
|
|
@param contenttype: Optional.
|
|
|
@param headers: Optional. Base set of headers.
|
|
@param headers: Optional. Base set of headers.
|
|
|
|
|
+ @param allow_redirects: Optional. Allow request to automatically resolve redirects.
|
|
|
|
|
|
|
|
@return: A dictionary of the JSON result.
|
|
@return: A dictionary of the JSON result.
|
|
|
"""
|
|
"""
|
|
|
return self.invoke("POST", relpath, params, data, self._make_headers(contenttype, headers), files)
|
|
return self.invoke("POST", relpath, params, data, self._make_headers(contenttype, headers), files)
|
|
|
|
|
|
|
|
|
|
|
|
|
- def put(self, relpath=None, params=None, data=None, contenttype=None):
|
|
|
|
|
|
|
+ def put(self, relpath=None, params=None, data=None, contenttype=None, allow_redirects=False):
|
|
|
"""
|
|
"""
|
|
|
Invoke the PUT method on a resource.
|
|
Invoke the PUT method on a resource.
|
|
|
@param relpath: Optional. A relative path to this resource's path.
|
|
@param relpath: Optional. A relative path to this resource's path.
|
|
|
@param params: Key-value data.
|
|
@param params: Key-value data.
|
|
|
@param data: Optional. Body of the request.
|
|
@param data: Optional. Body of the request.
|
|
|
@param contenttype: Optional.
|
|
@param contenttype: Optional.
|
|
|
|
|
+ @param allow_redirects: Optional. Allow request to automatically resolve redirects.
|
|
|
|
|
|
|
|
@return: A dictionary of the JSON result.
|
|
@return: A dictionary of the JSON result.
|
|
|
"""
|
|
"""
|
|
|
- return self.invoke("PUT", relpath, params, data, self._make_headers(contenttype))
|
|
|
|
|
|
|
+ return self.invoke("PUT", relpath, params, data, self._make_headers(contenttype), allow_redirects)
|
|
|
|
|
|
|
|
|
|
|
|
|
def _make_headers(self, contenttype=None, headers=None):
|
|
def _make_headers(self, contenttype=None, headers=None):
|