mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Set API key as session header on MagicPlanClient construction 🟩
This commit is contained in:
parent
da4f5f44c0
commit
d59bf2d7cb
1 changed files with 1 additions and 1 deletions
|
|
@ -9,7 +9,7 @@ class MagicPlanClient:
|
||||||
def __init__(self, customer_id: str, api_key: str) -> None:
|
def __init__(self, customer_id: str, api_key: str) -> None:
|
||||||
self._api_key = api_key
|
self._api_key = api_key
|
||||||
self._session = requests.Session()
|
self._session = requests.Session()
|
||||||
self._session.headers.update({"customer": customer_id})
|
self._session.headers.update({"customer": customer_id, "key": api_key})
|
||||||
|
|
||||||
def get_plans(self) -> PlansListResponse:
|
def get_plans(self) -> PlansListResponse:
|
||||||
r = self._session.get(f"{_BASE_URL}/plans", params={"key": self._api_key})
|
r = self._session.get(f"{_BASE_URL}/plans", params={"key": self._api_key})
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue