wip: planning

This commit is contained in:
Michael Costa
2023-04-09 06:17:34 +11:00
parent 27a6205595
commit a76b8e034a
30 changed files with 1078 additions and 22 deletions

View File

@@ -0,0 +1,15 @@
import requests
import logging
class Backend:
def __init__(self, url, apiprefix, apikey):
self.url = url
self.apiprefix = apiprefix
self.apikey = apikey
self.session = requests.Session()
def get(self, endpoint, params=None):
url = f"{self.url}/{self.apiprefix}/{endpoint}"
headers = {"Authorization": f"Token {self.apikey}",
"Accept": "application/json"}
return self.session.get(url, params=params, headers=headers)