mirror of
https://github.com/creyD/creyPY.git
synced 2026-04-14 20:30:31 +02:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8b781b3e7 | ||
|
|
93c7f6f6cb | ||
|
|
2e44453915 | ||
|
|
2a22471de9 | ||
| 2176b1a37d |
@@ -1,11 +1,13 @@
|
|||||||
import json
|
import json
|
||||||
from httpx import AsyncClient
|
from httpx import ASGITransport, AsyncClient
|
||||||
|
|
||||||
|
|
||||||
class AsyncGenericClient:
|
class AsyncGenericClient:
|
||||||
def __init__(self, app):
|
def __init__(self, app, headers={}):
|
||||||
self.c = AsyncClient(app=app, base_url="http://testserver", follow_redirects=True)
|
self.c = AsyncClient(
|
||||||
self.default_headers = {}
|
transport=ASGITransport(app=app), base_url="http://testserver", follow_redirects=True
|
||||||
|
)
|
||||||
|
self.default_headers = 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):
|
||||||
re = await self.c.get(url, headers=self.default_headers)
|
re = await self.c.get(url, headers=self.default_headers)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
cachetools==5.5.0 # for caching
|
cachetools>=5.5.0 # for caching
|
||||||
charset-normalizer==3.4.0 # Auth0 API interactions
|
charset-normalizer>=3.4.0 # Auth0 API interactions
|
||||||
requests==2.32.3 # Auth0 API interactions
|
requests>=2.32.3 # Auth0 API interactions
|
||||||
pyjwt==2.10.0 # Auth0 API interactions
|
pyjwt>=2.10.1 # Auth0 API interactions
|
||||||
cffi==1.17.1 # Auth0 API interactions
|
cffi>=1.17.1 # Auth0 API interactions
|
||||||
cryptography==43.0.3 # Auth0 API interactions
|
cryptography>=43.0.3 # Auth0 API interactions
|
||||||
pycparser==2.22 # Auth0 API interactions
|
pycparser>=2.22 # Auth0 API interactions
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ starlette>=0.37.2 # FastAPI
|
|||||||
|
|
||||||
fastapi-pagination>=0.12.26 # Pagination
|
fastapi-pagination>=0.12.26 # Pagination
|
||||||
sqlalchemy>=2.0.31 # SQLAlchemy
|
sqlalchemy>=2.0.31 # SQLAlchemy
|
||||||
sqlalchemy-utils==0.41.2 # For managing databases
|
sqlalchemy-utils>=0.41.2 # For managing databases
|
||||||
|
|
||||||
python-dotenv>=1.0.1 # Environment variables
|
python-dotenv>=1.0.1 # Environment variables
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user