Beispiel #1
0
 def get(self, path, **kwargs) -> dict:
     """
     Args:
         path:
         **kwargs:
     """
     with handler_request(self, LOGGER):
         url = self.base_url + path
         response = self.request.get(url, **kwargs)
         if not response.ok:
             raise handler_request_exception(response)
         return response.json()
Beispiel #2
0
    def delete(self, path: str, **kwargs) -> Union[bool, dict]:
        """
        Args:
            path (str):
            **kwargs:
        """
        with handler_request(self, LOGGER):
            url = self.base_url + path
            response = self.request.delete(url, **kwargs)
            if not response.ok:
                raise handler_request_exception(response)

            return True
Beispiel #3
0
 def _handler_request(self):
     return handler_request(self, LOGGER)