Initialise client. Args: base_url (str): The base URL to the service being used. username (str): The username to authenticate with. api_key (str): The API key to authenticate with. timeout (int): Maximum time before timing out.
(self, base_url, username=None, api_key=None, status_endpoint=None, timeout=60)
| 32 | api_base = None |
| 33 | |
| 34 | def __init__(self, base_url, username=None, api_key=None, status_endpoint=None, timeout=60): |
| 35 | """Initialise client. |
| 36 | |
| 37 | Args: |
| 38 | base_url (str): The base URL to the service being used. |
| 39 | username (str): The username to authenticate with. |
| 40 | api_key (str): The API key to authenticate with. |
| 41 | timeout (int): Maximum time before timing out. |
| 42 | """ |
| 43 | self.base_url = base_url |
| 44 | self.username = username |
| 45 | self.api_key = api_key |
| 46 | self.status_endpoint = urljoin(self.base_url, status_endpoint) |
| 47 | self.timeout = timeout |
| 48 | |
| 49 | @staticmethod |
| 50 | def encode(request, data): |