[UP] api_manager.py
This commit is contained in:
parent
c0670b2f18
commit
2400dfecc3
1 changed files with 1 additions and 0 deletions
|
|
@ -29,6 +29,7 @@ class AsteriskManagerClient:
|
||||||
headers = kwargs.get('headers', {})
|
headers = kwargs.get('headers', {})
|
||||||
if self.token:
|
if self.token:
|
||||||
headers['Authorization'] = f'Bearer {self.token}'
|
headers['Authorization'] = f'Bearer {self.token}'
|
||||||
|
kwargs['headers'] = headers
|
||||||
async with aiohttp.ClientSession() as session:
|
async with aiohttp.ClientSession() as session:
|
||||||
async with session.request(method, f"{self.base_url}{endpoint}", **kwargs) as response:
|
async with session.request(method, f"{self.base_url}{endpoint}", **kwargs) as response:
|
||||||
if response.status >= 400:
|
if response.status >= 400:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue