summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-03-22 14:58:01 -0300
committerdrebs <drebs@leap.se>2017-04-04 18:27:38 +0200
commit5acadaa7716a86448af02c3a078759ddddd45c85 (patch)
treeec5aae2220b4add9f2ad504282308c5456a034b4
parentfd2312a43bd5db449a43f1304416c073f8566bc1 (diff)
[refactor] simplify HTTPClient
-rw-r--r--client/src/leap/soledad/client/_http.py25
1 files changed, 2 insertions, 23 deletions
diff --git a/client/src/leap/soledad/client/_http.py b/client/src/leap/soledad/client/_http.py
index 20e61685..ba6f9a27 100644
--- a/client/src/leap/soledad/client/_http.py
+++ b/client/src/leap/soledad/client/_http.py
@@ -34,36 +34,15 @@ from leap.common.certs import get_compatible_ssl_context_factory
__all__ = ['HTTPClient', 'PinnedTokenAgent']
-class HTTPClient(object):
+class HTTPClient(_HTTPClient):
def __init__(self, uuid, token, cert_file):
self._agent = PinnedTokenAgent(uuid, token, cert_file)
- self._client = _HTTPClient(self._agent)
+ super(self.__class__, self).__init__(self._agent)
def set_token(self, token):
self._agent.set_token(token)
- def head(self, url, **kwargs):
- return self._client.head(url, **kwargs)
-
- def get(self, url, headers=None, **kwargs):
- return self._client.get(url, headers=headers, **kwargs)
-
- def post(self, url, data=None, **kwargs):
- return self._client.post(url, data=data, **kwargs)
-
- def put(self, url, data=None, **kwargs):
- return self._client.put(url, data=data, **kwargs)
-
- def patch(self, url, data=None, **kwargs):
- return self._client.patch(url, data=data, **kwargs)
-
- def delete(self, url, **kwargs):
- return self._client.delete(url, **kwargs)
-
- def request(self, method, url, **kwargs):
- return self._client.request(method, url, **kwargs)
-
@implementer(IAgent)
class PinnedTokenAgent(Agent):