async def log_request_and_response(request: Request, call_next) -> Response:
"client": request.client[0],
"method": request.method,
"path": request.url.path,
"params": dict(request.query_params),
"body": await request.body(),
response = await call_next(request)
async for chunk in response.body_iterator:
data["data"] = response_body.decode()[:256]
status_code=response.status_code,
headers=dict(response.headers),
media_type=response.media_type,