(endpoint: str, dct: dict | None = None)
| 35 | |
| 36 | |
| 37 | def post(endpoint: str, dct: dict | None = None): |
| 38 | req = requests.post(f'{sd_url}{endpoint}', json = dct, timeout=300, verify=False, auth=auth()) |
| 39 | if req.status_code != 200: |
| 40 | return { 'error': req.status_code, 'reason': req.reason, 'url': req.url } |
| 41 | else: |
| 42 | return req.json() |
| 43 | |
| 44 | |
| 45 | def info(args): # pylint: disable=redefined-outer-name |