- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 39 for include_router (0.13 sec)
-
docs/en/docs/reference/fastapi.md
options: members: - openapi_version - webhooks - state - dependency_overrides - openapi - websocket - include_router - get - put - post - delete - options - head - patch - trace - on_event
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:53:19 UTC 2024 - 701 bytes - Viewed (0) -
tests/test_custom_route_class.py
@router_b.get("/") def get_b(): return {"msg": "B"} @router_c.get("/") def get_c(): return {"msg": "C"} router_b.include_router(router=router_c, prefix="/c") router_a.include_router(router=router_b, prefix="/b") app.include_router(router=router_a, prefix="/a") client = TestClient(app) @pytest.mark.parametrize( "path,expected_status,expected_response", [
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 3.1K bytes - Viewed (0) -
tests/test_ws_router.py
async def router_ws_custom_error(websocket: WebSocket): raise CustomError() def make_app(app=None, **kwargs): app = app or FastAPI(**kwargs) app.include_router(router) app.include_router(prefix_router, prefix="/prefix") app.include_router(native_prefix_route) return app app = make_app(app) def test_app(): client = TestClient(app)
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Jun 11 19:08:14 UTC 2023 - 7.5K bytes - Viewed (0) -
tests/test_empty_router.py
from fastapi.exceptions import FastAPIError from fastapi.testclient import TestClient app = FastAPI() router = APIRouter() @router.get("") def get_empty(): return ["OK"] app.include_router(router, prefix="/prefix") client = TestClient(app) def test_use_empty(): with client: response = client.get("/prefix") assert response.status_code == 200, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Jun 11 22:37:34 UTC 2023 - 805 bytes - Viewed (0) -
tests/test_router_redirect_slashes.py
def test_redirect_slashes_enabled(): app = FastAPI() router = APIRouter() @router.get("/hello/") def hello_page() -> str: return "Hello, World!" app.include_router(router) client = TestClient(app) response = client.get("/hello/", follow_redirects=False) assert response.status_code == 200 response = client.get("/hello", follow_redirects=False)
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Jun 22 10:37:50 UTC 2023 - 974 bytes - Viewed (0) -
tests/test_include_route.py
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/") assert response.status_code == 200, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Apr 08 04:37:38 UTC 2020 - 496 bytes - Viewed (0) -
tests/test_generate_unique_id_function.py
responses={404: {"model": List[Message]}}, ) def post_subrouter(item1: Item, item2: Item): return item1, item2 # pragma: nocover router.include_router(sub_router) app.include_router(router, generate_unique_id_function=custom_generate_unique_id3) client = TestClient(app) response = client.get("/openapi.json") data = response.json() assert data == {
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Jan 13 15:10:26 UTC 2024 - 66.7K bytes - Viewed (0) -
docs/em/docs/tutorial/bigger-applications.md
## ๐ ๐ ๐ป ๐ ๐ฐ โฎ๏ธ ๐ `prefix` ๐ ๐ช โ๏ธ `.include_router()` ๐ ๐ฐ โฎ๏ธ *๐* ๐ป โ๏ธ ๐ ๐ก. ๐ ๐ช โ , ๐ผ, ๐ฆ ๐ ๐ ๏ธ ๐ฝ ๐ ๐ก, โ `/api/v1` & `/api/latest`. ๐ ๐ง โ๏ธ ๐ ๐ 5๏ธโฃ๐ ๐ซ ๐ค ๐ช, โ๏ธ โซ๏ธ ๐ค ๐ผ ๐. ## ๐ `APIRouter` โ1๏ธโฃ ๐ ๐ ๐ ๐ช ๐ `APIRouter` `FastAPI` ๐ธ, ๐ ๐ช ๐ `APIRouter` โ1๏ธโฃ `APIRouter` โ๏ธ: ```Python router.include_router(other_router) ```
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 15.5K bytes - Viewed (0) -
docs/de/docs/tutorial/bigger-applications.md
``` /// info `users.router` enthรคlt den `APIRouter` in der Datei `app/routers/users.py`. Und `items.router` enthรคlt den `APIRouter` in der Datei `app/routers/items.py`. /// Mit `app.include_router()` kรถnnen wir jeden `APIRouter` zur Hauptanwendung `FastAPI` hinzufรผgen. Es wird alle Routen von diesem Router als Teil von dieser inkludieren. /// note | "Technische Details"
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 21K bytes - Viewed (0) -
docs/en/docs/reference/apirouter.md
You can import the `APIRouter` class directly from `fastapi`: ```python from fastapi import APIRouter ``` ::: fastapi.APIRouter options: members: - websocket - include_router - get - put - post - delete - options - head - patch - trace
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:53:19 UTC 2024 - 524 bytes - Viewed (0)