Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 182 for Reuter (0.21 sec)

  1. tests/test_ws_router.py

    def test_router():
        client = TestClient(app)
        with client.websocket_connect("/router") as websocket:
            data = websocket.receive_text()
            assert data == "Hello, router!"
    
    
    def test_prefix_router():
        client = TestClient(app)
        with client.websocket_connect("/prefix/") as websocket:
            data = websocket.receive_text()
            assert data == "Hello, router with prefix!"
    
    
    def test_native_prefix_router():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jun 11 19:08:14 GMT 2023
    - 7.5K bytes
    - Viewed (0)
  2. tests/test_default_response_class_router.py

    )
    router_b_override.include_router(router_b_a, prefix="/a")
    router_a.include_router(router_a_a, prefix="/a")
    router_a.include_router(
        router_a_b_override, prefix="/b", default_response_class=PlainTextResponse
    )
    app.include_router(router_a, prefix="/a")
    app.include_router(
        router_b_override, prefix="/b", default_response_class=PlainTextResponse
    )
    
    
    client = TestClient(app)
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Mar 01 20:49:20 GMT 2020
    - 5K bytes
    - Viewed (0)
  3. docs/en/docs/tutorial/bigger-applications.md

    We are importing the submodule `items` directly, instead of importing just its variable `router`.
    
    This is because we also have another variable named `router` in the submodule `users`.
    
    If we had imported one after the other, like:
    
    ```Python
    from .routers.items import router
    from .routers.users import router
    ```
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 18.6K bytes
    - Viewed (0)
  4. tests/test_dependency_overrides.py

    
    @router.get("/router-depends/")
    async def router_depends(commons: dict = Depends(common_parameters)):
        return {"in": "router-depends", "params": commons}
    
    
    @router.get("/router-decorator-depends/", dependencies=[Depends(common_parameters)])
    async def router_decorator_depends():
        return {"in": "router-decorator-depends"}
    
    
    app.include_router(router)
    
    client = TestClient(app)
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 15.4K bytes
    - Viewed (0)
  5. tests/test_operations_signatures.py

        for method_name in method_names:
            router_method = getattr(APIRouter, method_name)
            app_method = getattr(FastAPI, method_name)
            router_sig = inspect.signature(router_method)
            app_sig = inspect.signature(app_method)
            param: inspect.Parameter
            for key, param in base_sig.parameters.items():
                router_param: inspect.Parameter = router_sig.parameters[key]
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon May 27 12:08:13 GMT 2019
    - 934 bytes
    - Viewed (0)
  6. docs/en/docs/python-types.md

    These **"type hints"** or annotations are a special syntax that allow declaring the <abbr title="for example: str, int, float, bool">type</abbr> of a variable.
    
    By declaring types for your variables, editors and tools can give you better support.
    
    This is just a **quick tutorial / refresher** about Python type hints. It covers only the minimum necessary to use them with **FastAPI**... which is actually very little.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17K bytes
    - Viewed (0)
  7. 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):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 407 bytes
    - Viewed (0)
  8. docs/en/docs/css/custom.css

    }
    
    .user .title {
      text-align: center;
    }
    
    .user .count {
      font-size: 80%;
      text-align: center;
    }
    
    a.announce-link:link,
    a.announce-link:visited {
      color: #fff;
    }
    
    a.announce-link:hover {
      color: var(--md-accent-fg-color);
    }
    
    .announce-wrapper {
      display: flex;
      justify-content: space-between;
      flex-wrap: wrap;
      align-items: center;
    }
    
    .announce-wrapper div.item {
    CSS
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jan 28 09:53:45 GMT 2024
    - 2.8K bytes
    - Viewed (0)
  9. docs/zh/docs/tutorial/bigger-applications.md

    ### 避免名称冲突
    
    我们将直接导入 `items` 子模块,而不是仅导入其 `router` 变量。
    
    这是因为我们在 `users` 子模块中也有另一个名为 `router` 的变量。
    
    如果我们一个接一个地导入,例如:
    
    ```Python
    from .routers.items import router
    from .routers.users import router
    ```
    
    来自 `users` 的 `router` 将覆盖来自 `items` 中的 `router`,我们将无法同时使用它们。
    
    因此,为了能够在同一个文件中使用它们,我们直接导入子模块:
    
    ```Python hl_lines="5" title="app/main.py"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 18.5K bytes
    - Viewed (0)
  10. docs_src/openapi_callbacks/tutorial001.py

    
    class InvoiceEventReceived(BaseModel):
        ok: bool
    
    
    invoices_callback_router = APIRouter()
    
    
    @invoices_callback_router.post(
        "{$callback_url}/invoices/{$request.body.id}", response_model=InvoiceEventReceived
    )
    def invoice_notification(body: InvoiceEvent):
        pass
    
    
    @app.post("/invoices/", callbacks=invoices_callback_router.routes)
    def create_invoice(invoice: Invoice, callback_url: Union[HttpUrl, None] = None):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 1.3K bytes
    - Viewed (0)
Back to top