- Sort Score
- Num 10 results
- Language All
Results 21 - 30 of 388 for Router (0.04 seconds)
The search processing time has exceeded the limit. The displayed results may be partial.
-
tests/test_security_oauth2_authorization_code_bearer_scopes_openapi.py
) async def read_with_get_token(): return {"message": "Admin Access"} router = APIRouter(dependencies=[Security(oauth2_scheme, scopes=["read"])]) @router.get("/items/") async def read_items(token: Optional[str] = Depends(oauth2_scheme)): return {"token": token} @router.post("/items/") async def create_item( token: Optional[str] = Security(oauth2_scheme, scopes=["read", "write"]),
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 21:25:59 GMT 2025 - 6.6K bytes - Click Count (0) -
docs/pt/docs/tutorial/bigger-applications.md
Estamos importando o submódulo `items` diretamente, em vez de importar apenas sua variável `router`. Isso ocorre porque também temos outra variável chamada `router` no submódulo `users`. Se tivéssemos importado um após o outro, como: ```Python from .routers.items import router from .routers.users import router ``` o `router` de `users` sobrescreveria o de `items` e não poderíamos usá-los ao mesmo tempo.
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Tue Dec 16 20:32:40 GMT 2025 - 19.7K bytes - Click Count (0) -
tests/test_custom_route_class.py
assert response.json() == expected_response def test_route_classes(): routes = {} for r in app.router.routes: assert isinstance(r, Route) routes[r.path] = r assert getattr(routes["/a/"], "x_type") == "A" # noqa: B009 assert getattr(routes["/a/b/"], "x_type") == "B" # noqa: B009 assert getattr(routes["/a/b/c/"], "x_type") == "C" # noqa: B009 def test_openapi_schema():
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 3.1K bytes - Click Count (0) -
tests/test_include_route.py
from fastapi.responses import JSONResponse from fastapi.testclient import TestClient app = FastAPI() router = APIRouter() @router.route("/items/") def read_items(request: Request): return JSONResponse({"hello": "world"}) app.include_router(router) client = TestClient(app) def test_sub_router(): response = client.get("/items/")
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Apr 08 04:37:38 GMT 2020 - 496 bytes - Click Count (0) -
docs_src/custom_request_and_route/tutorial003_py310.py
response.headers["X-Response-Time"] = str(duration) print(f"route duration: {duration}") print(f"route response: {response}") print(f"route response headers: {response.headers}") return response return custom_route_handler app = FastAPI() router = APIRouter(route_class=TimedRoute) @app.get("/") async def not_timed():
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 10 08:55:32 GMT 2025 - 1K bytes - Click Count (0) -
fastapi/routing.py
if responses is None: responses = {} for route in router.routes: if isinstance(route, APIRoute): combined_responses = {**responses, **route.responses} use_response_class = get_value_or_default( route.response_class, router.default_response_class, default_response_class,Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 12:54:56 GMT 2025 - 174.6K bytes - Click Count (0) -
tests/test_modules_same_name_body/app/main.py
from fastapi import FastAPI from . import a, b app = FastAPI() app.include_router(a.router, prefix="/a")
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Jun 28 17:35:16 GMT 2019 - 150 bytes - Click Count (0) -
tests/test_modules_same_name_body/app/a.py
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 160 bytes - Click Count (0) -
docs_src/bigger_applications/app_py39/internal/admin.py
from fastapi import APIRouter router = APIRouter() @router.post("/") async def update_admin():
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 147 bytes - Click Count (0) -
docs/en/docs/how-to/custom-request-and-route.md
## Custom `APIRoute` class in a router { #custom-apiroute-class-in-a-router } You can also set the `route_class` parameter of an `APIRouter`: {* ../../docs_src/custom_request_and_route/tutorial003_py310.py hl[26] *}Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 10 08:55:32 GMT 2025 - 4.6K bytes - Click Count (0)