- Sort Score
- Result 10 results
- Languages All
Results 1 - 1 of 1 for response_status_setter (0.19 sec)
-
tests/test_response_change_status_code.py
from fastapi import Depends, FastAPI, Response from fastapi.testclient import TestClient app = FastAPI() async def response_status_setter(response: Response): response.status_code = 201 async def parent_dep(result=Depends(response_status_setter)): return result @app.get("/", dependencies=[Depends(parent_dep)]) async def get_main(): return {"msg": "Hello World"} client = TestClient(app)
Registered: Mon Jun 17 08:32:26 UTC 2024 - Last Modified: Wed Apr 08 04:37:38 UTC 2020 - 589 bytes - Viewed (0)