mirror of
https://github.com/creyD/creyPY.git
synced 2026-04-15 04:40:36 +02:00
fix: httpx fix as per latest version (#25)
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
import json
|
import json
|
||||||
from httpx import AsyncClient
|
from httpx import AsyncClient, ASGITransport
|
||||||
|
|
||||||
|
|
||||||
class AsyncGenericClient:
|
class AsyncGenericClient:
|
||||||
def __init__(self, app):
|
def __init__(self, app):
|
||||||
self.c = AsyncClient(app=app, base_url="http://testserver", follow_redirects=True)
|
self.c = AsyncClient(transport=ASGITransport(app=app), base_url="http://testserver", follow_redirects=True)
|
||||||
self.default_headers = {}
|
self.default_headers = {}
|
||||||
|
|
||||||
async def get(self, url: str, r_code: int = 200, parse_json=True):
|
async def get(self, url: str, r_code: int = 200, parse_json=True):
|
||||||
|
|||||||
Reference in New Issue
Block a user