fixed scicat for new httpclient

This commit is contained in:
2021-06-01 15:54:16 +02:00
parent f2aa686aa8
commit fe6bf79fa6
2 changed files with 17 additions and 9 deletions

View File

@ -24,6 +24,7 @@ class HttpClient(AuthMixin):
def __init__(self, address):
self.address = address
self._verify_certificate = True
self.login_path = self.address + "/users/login"
super().__init__(address)
def authenticate(self, username, password):
@ -54,7 +55,7 @@ class HttpClient(AuthMixin):
return requests.post(url, json=payload, headers=headers, timeout=timeout, verify=self._verify_certificate).json()
def _login(self, payload=None, headers=None, timeout=10):
return requests.post(self.address + "/users/login", json=payload, headers=headers, timeout=timeout, verify=self._verify_certificate).json()
return requests.post(self.login_path, json=payload, headers=headers, timeout=timeout, verify=self._verify_certificate).json()
@staticmethod
def make_filter(where:dict=None, limit:int=0, skip:int=0, fields:dict=None, include:dict=None, order:list=None):