(endpoint: str, json: dict | None = None)
| 94 | |
| 95 | |
| 96 | async def get(endpoint: str, json: dict | None = None): |
| 97 | global sess # pylint: disable=global-statement |
| 98 | sess = sess if sess is not None else await session() |
| 99 | try: |
| 100 | async with sess.get(url=endpoint, json=json, verify_ssl=False) as req: |
| 101 | res = await result(req) |
| 102 | return res |
| 103 | except Exception as err: |
| 104 | log.error({ 'session': err }) |
| 105 | return {} |
| 106 | |
| 107 | |
| 108 | def getsync(endpoint: str, json: dict | None = None): |