Updated requests, added express_report

This commit is contained in:
2025-03-12 19:03:13 +03:00
parent b380875582
commit 6fcb30c497
2 changed files with 30 additions and 5 deletions

View File

@@ -22,14 +22,16 @@ class Request:
self.inn = inn
self.ogrn = ogrn
def get(self, path: str):
def get(self, path: str, **add_params):
full_url = f'{self.base_url}{path}'
if self._access_key:
payload = {'key': self._access_key, 'inn': self.inn, 'ogrn': self.ogrn}
payload.update(add_params)
elif self._api_key:
payload = {'api-key': self._api_key, 'inn': self.inn, 'ogrn': self.ogrn}
payload.update(add_params)
try:
response = requests.get(url=full_url, params=payload)