Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 56 for 26 (0.11 sec)

  1. docs/zh/docs/advanced/custom-request-and-route.md

    接下来,创建使用 `GzipRequest` 的 `fastapi.routing.APIRoute  ` 的自定义子类。
    
    此时,这个自定义子类会覆盖 `APIRoute.get_route_handler()`。
    
    `APIRoute.get_route_handler()` 方法返回的是函数,并且返回的函数接收请求并返回响应。
    
    本例用它根据原始请求创建 `GzipRequest`。
    
    ```Python hl_lines="18-26"
    {!../../../docs_src/custom_request_and_route/tutorial001.py!}
    ```
    
    !!! note "技术细节"
    
        `Request` 的 `request.scope` 属性是包含关联请求元数据的字典。
    
        `Request` 的 `request.receive` 方法是**接收**请求体的函数。
    
    Plain Text
    - Registered: Sun Mar 31 07:19:09 GMT 2024
    - Last Modified: Sat Mar 30 22:45:40 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  2. docs/en/docs/how-to/custom-request-and-route.md

    This method returns a function. And that function is what will receive a request and return a response.
    
    Here we use it to create a `GzipRequest` from the original request.
    
    ```Python hl_lines="18-26"
    {!../../../docs_src/custom_request_and_route/tutorial001.py!}
    ```
    
    !!! note "Technical Details"
        A `Request` has a `request.scope` attribute, that's just a Python `dict` containing the metadata related to the request.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Mar 31 23:52:53 GMT 2024
    - 4.4K bytes
    - Viewed (0)
  3. docs/em/docs/how-to/custom-request-and-route.md

    👉 🕰, ⚫️ 🔜 📁 👩‍🔬 `APIRoute.get_route_handler()`.
    
    👉 👩‍🔬 📨 🔢. & 👈 🔢 ⚫️❔ 🔜 📨 📨 & 📨 📨.
    
    📥 👥 ⚙️ ⚫️ ✍ `GzipRequest` ⚪️➡️ ⏮️ 📨.
    
    ```Python hl_lines="18-26"
    {!../../../docs_src/custom_request_and_route/tutorial001.py!}
    ```
    
    !!! note "📡 ℹ"
         `Request` ✔️ `request.scope` 🔢, 👈 🐍 `dict` ⚗ 🗃 🔗 📨.
    
         `Request` ✔️ `request.receive`, 👈 🔢 "📨" 💪 📨.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 3.6K bytes
    - Viewed (0)
  4. docs/zh/docs/advanced/testing-dependencies.md

    ### 使用 `app.dependency_overrides` 属性
    
    对于这些用例,**FastAPI** 应用支持 `app.dependcy_overrides` 属性,该属性就是**字典**。
    
    要在测试时覆盖原有依赖项,这个字典的键应当是原依赖项(函数),值是覆盖依赖项(另一个函数)。
    
    这样一来,**FastAPI** 就会调用覆盖依赖项,不再调用原依赖项。
    
    ```Python hl_lines="26-27  30"
    {!../../../docs_src/dependency_testing/tutorial001.py!}
    ```
    
    !!! tip "提示"
    
        **FastAPI** 应用中的任何位置都可以实现覆盖依赖项。
    
        原依赖项可用于*路径操作函数*、*路径操作装饰器*(不需要返回值时)、`.include_router()` 调用等。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 22:45:53 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  5. docs/de/docs/how-to/extending-openapi.md

    Es wird nur einmal generiert und dann wird dasselbe zwischengespeicherte Schema für die nächsten Requests verwendet.
    
    ```Python hl_lines="13-14  25-26"
    {!../../../docs_src/extending_openapi/tutorial001.py!}
    ```
    
    ### Die Methode überschreiben
    
    Jetzt können Sie die Methode `.openapi()` durch Ihre neue Funktion ersetzen.
    
    ```Python hl_lines="29"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 14 16:44:05 GMT 2024
    - 3.7K bytes
    - Viewed (0)
  6. docs/em/docs/advanced/path-operation-advanced-configuration.md

    ⤴️ 👥 ⚙️ 📨 🔗, & ⚗ 💪 `bytes`. 👉 ⛓ 👈 FastAPI 🏆 🚫 🔄 🎻 📨 🚀 🎻.
    
    & ⤴️ 👆 📟, 👥 🎻 👈 📁 🎚 🔗, & ⤴️ 👥 🔄 ⚙️ 🎏 Pydantic 🏷 ✔ 📁 🎚:
    
    ```Python hl_lines="26-33"
    {!../../../docs_src/path_operation_advanced_configuration/tutorial007.py!}
    ```
    
    !!! tip
        📥 👥 🏤-⚙️ 🎏 Pydantic 🏷.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 5.7K bytes
    - Viewed (0)
  7. docs/de/docs/how-to/custom-request-and-route.md

    Diese Methode gibt eine Funktion zurück. Und diese Funktion empfängt einen Request und gibt eine Response zurück.
    
    Hier verwenden wir sie, um aus dem ursprünglichen Request einen `GzipRequest` zu erstellen.
    
    ```Python hl_lines="18-26"
    {!../../../docs_src/custom_request_and_route/tutorial001.py!}
    ```
    
    !!! note "Technische Details"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 18:18:23 GMT 2024
    - 5.2K bytes
    - Viewed (0)
  8. docs/de/docs/advanced/websockets.md

    In der Produktion hätten Sie eine der oben genannten Optionen.
    
    Aber es ist die einfachste Möglichkeit, sich auf die Serverseite von WebSockets zu konzentrieren und ein funktionierendes Beispiel zu haben:
    
    ```Python hl_lines="2  6-38  41-43"
    {!../../../docs_src/websockets/tutorial001.py!}
    ```
    
    ## Einen `websocket` erstellen
    
    Erstellen Sie in Ihrer **FastAPI**-Anwendung einen `websocket`:
    
    ```Python hl_lines="1  46-47"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:17:58 GMT 2024
    - 6.9K bytes
    - Viewed (0)
  9. docs/de/docs/advanced/middleware.md

    ```Python hl_lines="2  6"
    {!../../../docs_src/advanced_middleware/tutorial001.py!}
    ```
    
    ## `TrustedHostMiddleware`
    
    Erzwingt, dass alle eingehenden Requests einen korrekt gesetzten `Host`-Header haben, um sich vor HTTP-Host-Header-Angriffen zu schützen.
    
    ```Python hl_lines="2  6-8"
    {!../../../docs_src/advanced_middleware/tutorial002.py!}
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:18:15 GMT 2024
    - 4.4K bytes
    - Viewed (0)
  10. docs/zh/docs/advanced/middleware.md

    ## `HTTPSRedirectMiddleware`
    
    强制所有传入请求必须是 `https` 或 `wss`。
    
    任何传向 `http` 或 `ws` 的请求都会被重定向至安全方案。
    
    ```Python hl_lines="2  6"
    {!../../../docs_src/advanced_middleware/tutorial001.py!}
    ```
    
    ## `TrustedHostMiddleware`
    
    强制所有传入请求都必须正确设置 `Host` 请求头,以防 HTTP 主机头攻击。
    
    ```Python hl_lines="2  6-8"
    {!../../../docs_src/advanced_middleware/tutorial002.py!}
    ```
    
    支持以下参数:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 22:44:27 GMT 2024
    - 3.6K bytes
    - Viewed (0)
Back to top