Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 71 - 80 of 502 for tutorial001_an_py310 (0.1 seconds)

  1. docs/en/docs/advanced/additional-status-codes.md

    To achieve that, import `JSONResponse`, and return your content there directly, setting the `status_code` that you want:
    
    {* ../../docs_src/additional_status_codes/tutorial001_an_py310.py hl[4,25] *}
    
    /// warning
    
    When you return a `Response` directly, like in the example above, it will be returned directly.
    
    It won't be serialized with a model, etc.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 2K bytes
    - Click Count (0)
  2. docs/zh-hant/docs/how-to/custom-request-and-route.md

    {* ../../docs_src/custom_request_and_route/tutorial001_an_py310.py hl[9:16] *}
    
    ### 建立自訂的 `GzipRoute` 類別 { #create-a-custom-gziproute-class }
    
    接著,我們建立 `fastapi.routing.APIRoute` 的自訂子類別,讓它使用 `GzipRequest`。
    
    這次,它會覆寫 `APIRoute.get_route_handler()` 方法。
    
    這個方法會回傳一個函式,而該函式會接收請求並回傳回應。
    
    在這裡,我們用它將原始的請求包裝成 `GzipRequest`。
    
    {* ../../docs_src/custom_request_and_route/tutorial001_an_py310.py hl[19:27] *}
    
    /// note | 技術細節
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 4.2K bytes
    - Click Count (0)
  3. docs/zh-hant/docs/how-to/authentication-error-status-code.md

    但如果你的用戶端因某些原因依賴於舊行為,你可以在你的 security 類別中覆寫 `make_not_authenticated_error` 方法以恢復舊的行為。
    
    例如,你可以建立 `HTTPBearer` 的子類別,讓它回傳 `403 Forbidden` 錯誤,而不是預設的 `401 Unauthorized` 錯誤:
    
    {* ../../docs_src/authentication_error_status_code/tutorial001_an_py310.py hl[9:13] *}
    
    /// tip
    注意這個函式回傳的是例外物件本身,而不是直接拋出它。拋出的動作會在其餘的內部程式碼中處理。
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 1.1K bytes
    - Click Count (0)
  4. docs/en/docs/tutorial/query-param-models.md

    Declare the **query parameters** that you need in a **Pydantic model**, and then declare the parameter as `Query`:
    
    {* ../../docs_src/query_param_models/tutorial001_an_py310.py hl[9:13,17] *}
    
    **FastAPI** will **extract** the data for **each field** from the **query parameters** in the request and give you the Pydantic model you defined.
    
    ## Check the Docs { #check-the-docs }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Aug 31 09:15:41 GMT 2025
    - 2.2K bytes
    - Click Count (0)
  5. docs/ko/docs/tutorial/dependencies/classes-as-dependencies.md

    {* ../../docs_src/dependencies/tutorial002_an_py310.py hl[11:15] *}
    
    클래스의 인스턴스를 만들 때 사용하는 `__init__` 메서드에 주목하세요:
    
    {* ../../docs_src/dependencies/tutorial002_an_py310.py hl[12] *}
    
    ...이전의 `common_parameters`와 동일한 매개변수를 가지고 있습니다:
    
    {* ../../docs_src/dependencies/tutorial001_an_py310.py hl[8] *}
    
    이 매개변수들이 **FastAPI**가 의존성을 "해결"하는 데 사용할 것들입니다.
    
    두 경우 모두 다음을 갖게 됩니다:
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Feb 14 08:57:01 GMT 2026
    - 8K bytes
    - Click Count (0)
  6. docs/zh/docs/tutorial/header-param-models.md

    ///
    
    ## 使用 Pydantic 模型的 Header 参数 { #header-parameters-with-a-pydantic-model }
    
    在 **Pydantic 模型**中声明所需的 **header 参数**,然后将参数声明为 `Header` :
    
    {* ../../docs_src/header_param_models/tutorial001_an_py310.py hl[9:14,18] *}
    
    **FastAPI** 将从请求中接收到的 **headers** 中**提取**出**每个字段**的数据,并提供您定义的 Pydantic 模型。
    
    ## 查看文档 { #check-the-docs }
    
    您可以在文档 UI 的 `/docs` 中查看所需的 headers:
    
    <div class="screenshot">
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Feb 08 10:39:41 GMT 2026
    - 2.5K bytes
    - Click Count (0)
  7. docs/ja/docs/how-to/custom-request-and-route.md

    同じアプローチを使って、例外ハンドラ内でリクエストボディにアクセスすることもできます。
    
    やることは、`try`/`except` ブロックの中でリクエストを処理するだけです:
    
    {* ../../docs_src/custom_request_and_route/tutorial002_an_py310.py hl[14,16] *}
    
    例外が発生しても、`Request` インスタンスはスコープ内に残るため、エラー処理時にリクエストボディを読み取り、活用できます:
    
    {* ../../docs_src/custom_request_and_route/tutorial002_an_py310.py hl[17:19] *}
    
    ## ルーターでのカスタム `APIRoute` クラス { #custom-apiroute-class-in-a-router }
    
    `APIRouter` の `route_class` パラメータを設定することもできます:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 5.4K bytes
    - Click Count (0)
  8. docs/en/docs/tutorial/cookie-param-models.md

    ## Cookies with a Pydantic Model { #cookies-with-a-pydantic-model }
    
    Declare the **cookie** parameters that you need in a **Pydantic model**, and then declare the parameter as `Cookie`:
    
    {* ../../docs_src/cookie_param_models/tutorial001_an_py310.py hl[9:12,16] *}
    
    **FastAPI** will **extract** the data for **each field** from the **cookies** received in the request and give you the Pydantic model you defined.
    
    ## Check the Docs { #check-the-docs }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 10 11:48:27 GMT 2026
    - 3.1K bytes
    - Click Count (0)
  9. docs/en/docs/tutorial/header-param-models.md

    Declare the **header parameters** that you need in a **Pydantic model**, and then declare the parameter as `Header`:
    
    {* ../../docs_src/header_param_models/tutorial001_an_py310.py hl[9:14,18] *}
    
    **FastAPI** will **extract** the data for **each field** from the **headers** in the request and give you the Pydantic model you defined.
    
    ## Check the Docs { #check-the-docs }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Aug 31 09:15:41 GMT 2025
    - 2.6K bytes
    - Click Count (0)
  10. docs/en/docs/tutorial/request-form-models.md

    You just need to declare a **Pydantic model** with the fields you want to receive as **form fields**, and then declare the parameter as `Form`:
    
    {* ../../docs_src/request_form_models/tutorial001_an_py310.py hl[9:11,15] *}
    
    **FastAPI** will **extract** the data for **each field** from the **form data** in the request and give you the Pydantic model you defined.
    
    ## Check the Docs { #check-the-docs }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 2.1K bytes
    - Click Count (0)
Back to Top