Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for 14 (0.11 sec)

  1. docs/en/docs/tutorial/handling-errors.md

    You probably won't need to use it directly in your code.
    
    But in case you needed it for an advanced scenario, you can add custom headers:
    
    ```Python hl_lines="14"
    {!../../../docs_src/handling_errors/tutorial002.py!}
    ```
    
    ## Install custom exception handlers
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  2. docs/zh/docs/tutorial/handling-errors.md

        **FastAPI** 能自动处理这些数据,并将之转换为 JSON。
    
    
    ## 添加自定义响应头
    
    有些场景下要为 HTTP 错误添加自定义响应头。例如,出于某些方面的安全需要。
    
    一般情况下可能不会需要在代码中直接使用响应头。
    
    但对于某些高级应用场景,还是需要添加自定义响应头:
    
    ```Python hl_lines="14"
    {!../../../docs_src/handling_errors/tutorial002.py!}
    
    ```
    
    ## 安装自定义异常处理器
    
    添加自定义处理器,要使用 [Starlette 的异常工具](https://www.starlette.io/exceptions/)。
    
    假设要触发的自定义异常叫作 `UnicornException`。
    
    且需要 FastAPI 实现全局处理该异常。
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  3. docs/em/docs/tutorial/handling-errors.md

        👫 🍵 🔁 **FastAPI** & 🗜 🎻.
    
    ## 🚮 🛃 🎚
    
    📤 ⚠ 🌐❔ ⚫️ ⚠ 💪 🚮 🛃 🎚 🇺🇸🔍 ❌. 🖼, 🆎 💂‍♂.
    
    👆 🎲 🏆 🚫 💪 ⚙️ ⚫️ 🔗 👆 📟.
    
    ✋️ 💼 👆 💪 ⚫️ 🏧 😐, 👆 💪 🚮 🛃 🎚:
    
    ```Python hl_lines="14"
    {!../../../docs_src/handling_errors/tutorial002.py!}
    ```
    
    ## ❎ 🛃 ⚠ 🐕‍🦺
    
    👆 💪 🚮 🛃 ⚠ 🐕‍🦺 ⏮️ <a href="https://www.starlette.io/exceptions/" class="external-link" target="_blank">🎏 ⚠ 🚙 ⚪️➡️ 💃</a>.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 8.3K bytes
    - Viewed (0)
Back to top