Minor code review

This commit is contained in:
Dion Moult
2021-08-12 17:56:58 +10:00
parent 7a5b15e5a2
commit 199bc86a88
3 changed files with 36 additions and 71 deletions
+1
View File
@@ -139,6 +139,7 @@ class BcfClient:
self.baseurl = version["api_base_url"]
def get(self, endpoint, params=None, is_auth_required=False):
# TODO: handle error http status codes and raise exception. Follow error.json standard.
headers = {"Authorization": "Bearer " + self.foundation_client.get_access_token()}
return requests.get(f"{self.baseurl}{endpoint}", headers=headers, params=params or None).json()