From 5acadaa7716a86448af02c3a078759ddddd45c85 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Wed, 22 Mar 2017 14:58:01 -0300 Subject: [refactor] simplify HTTPClient --- client/src/leap/soledad/client/_http.py | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) (limited to 'client/src/leap') 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): -- cgit v1.2.3