Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 179 for Routen (0.03 sec)

  1. tests/test_empty_router.py

    import pytest
    from fastapi import APIRouter, FastAPI
    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")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sun Jun 11 22:37:34 UTC 2023
    - 805 bytes
    - Viewed (1)
  2. docs_src/bigger_applications/app_an_py39/routers/users.py

    from fastapi import APIRouter
    
    router = APIRouter()
    
    
    @router.get("/users/", tags=["users"])
    async def read_users():
        return [{"username": "Rick"}, {"username": "Morty"}]
    
    
    @router.get("/users/me", tags=["users"])
    async def read_user_me():
        return {"username": "fakecurrentuser"}
    
    
    @router.get("/users/{username}", tags=["users"])
    async def read_user(username: str):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 407 bytes
    - Viewed (0)
  3. docs_src/bigger_applications/app_py39/routers/users.py

    from fastapi import APIRouter
    
    router = APIRouter()
    
    
    @router.get("/users/", tags=["users"])
    async def read_users():
        return [{"username": "Rick"}, {"username": "Morty"}]
    
    
    @router.get("/users/me", tags=["users"])
    async def read_user_me():
        return {"username": "fakecurrentuser"}
    
    
    @router.get("/users/{username}", tags=["users"])
    async def read_user(username: str):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 407 bytes
    - Viewed (0)
  4. docs_src/custom_request_and_route/tutorial003_py39.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():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 1K bytes
    - Viewed (0)
  5. docs/ru/docs/tutorial/bigger-applications.md

    Вместо того чтобы импортировать только переменную `router`, мы импортируем непосредственно суб-модуль `items`.
    
    Мы делаем это потому, что у нас есть ещё одна переменная `router` в суб-модуле `users`.
    
    Если бы мы импортировали их одну за другой, как показано в примере:
    
    ```Python
    from .routers.items import router
    from .routers.users import router
    ```
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Thu Dec 11 21:25:03 UTC 2025
    - 30.4K bytes
    - Viewed (0)
  6. docs/de/docs/_llm-test.md

    * <abbr title="Mozilla Developer Network – Mozilla-Entwicklernetzwerk: Dokumentation für Entwickler, geschrieben von den Firefox-Leuten">MDN</abbr>
    * <abbr title="Input/Output – Eingabe/Ausgabe: Lesen oder Schreiben auf der Festplatte, Netzwerkkommunikation.">I/O</abbr>.
    
    ////
    
    //// tab | Info
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 07:17:04 UTC 2025
    - 12.6K bytes
    - Viewed (0)
  7. src/test/java/jcifs/pac/PacMacTest.java

         */
        @Test
        void testExpandNFold() {
            // Test basic functionality
            byte[] data = { 1, 2, 3 };
            int outlen = 5;
            byte[] expanded = PacMac.expandNFold(data, outlen);
            assertNotNull(expanded);
            assertEquals(outlen, expanded.length);
    
            // Test vectors from RFC 3961 Appendix A.1
            // 64-fold("012345")
            verifyNfold("012345", 8,
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 7.1K bytes
    - Viewed (0)
  8. docs_src/extending_openapi/tutorial001_py39.py

            title="Custom title",
            version="2.5.0",
            summary="This is a very custom OpenAPI schema",
            description="Here's a longer description of the custom **OpenAPI** schema",
            routes=app.routes,
        )
        openapi_schema["info"]["x-logo"] = {
            "url": "https://fastapi.tiangolo.com/img/logo-margin/logo-teal.png"
        }
        app.openapi_schema = openapi_schema
        return app.openapi_schema
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 737 bytes
    - Viewed (0)
  9. docs_src/bigger_applications/app_an_py39/routers/items.py

    from ..dependencies import get_token_header
    
    router = APIRouter(
        prefix="/items",
        tags=["items"],
        dependencies=[Depends(get_token_header)],
        responses={404: {"description": "Not found"}},
    )
    
    
    fake_items_db = {"plumbus": {"name": "Plumbus"}, "gun": {"name": "Portal Gun"}}
    
    
    @router.get("/")
    async def read_items():
        return fake_items_db
    
    
    @router.get("/{item_id}")
    async def read_item(item_id: str):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 1011 bytes
    - Viewed (0)
  10. 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"]),
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 6.6K bytes
    - Viewed (0)
Back to top