Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 149 for body (0.14 sec)

  1. docs/zh/docs/tutorial/dependencies/index.md

    ### 导入 `Depends`
    
    ```Python hl_lines="3"
    {!../../../docs_src/dependencies/tutorial001.py!}
    ```
    
    ### 声明依赖项
    
    与在*路径操作函数*参数中使用 `Body`、`Query` 的方式相同,声明依赖项需要使用 `Depends` 和一个新的参数:
    
    ```Python hl_lines="15  20"
    {!../../../docs_src/dependencies/tutorial001.py!}
    ```
    
    虽然,在路径操作函数的参数中使用 `Depends` 的方式与 `Body`、`Query` 相同,但 `Depends` 的工作方式略有不同。
    
    这里只能传给 Depends 一个参数。
    
    且该参数必须是可调用对象,比如函数。
    
    该函数接收的参数和*路径操作函数*的参数一样。
    
    !!! tip "提示"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Jun 24 14:47:15 GMT 2023
    - 7K bytes
    - Viewed (0)
  2. docs/pl/docs/index.md

    * Alternatywna dokumentacja również pokaże zaktualizowane parametry i treść żądania (body):
    
    ![ReDoc](https://fastapi.tiangolo.com/img/index/index-06-redoc-02.png)
    
    ### Podsumowanie
    
    Podsumowując, musiałeś zadeklarować typy parametrów, treści żądania (body) itp. tylko **raz**, i są one dostępne jako parametry funkcji.
    
    Robisz to tak samo jak ze standardowymi typami w Pythonie.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Apr 29 05:18:04 GMT 2024
    - 19.4K bytes
    - Viewed (0)
  3. docs/ja/docs/tutorial/handling-errors.md

    ```
    
    受信したボディを含むデータが無効であることを示すレスポンスが表示されます:
    
    ```JSON hl_lines="12 13 14 15"
    {
      "detail": [
        {
          "loc": [
            "body",
            "size"
          ],
          "msg": "value is not a valid integer",
          "type": "type_error.integer"
        }
      ],
      "body": {
        "title": "towel",
        "size": "XL"
      }
    }
    ```
    
    #### FastAPIの`HTTPException`とStarletteの`HTTPException`
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 11.8K bytes
    - Viewed (0)
  4. docs/em/docs/tutorial/request-files.md

    ## 🗄 `File`
    
    🗄 `File` & `UploadFile` ⚪️➡️ `fastapi`:
    
    ```Python hl_lines="1"
    {!../../../docs_src/request_files/tutorial001.py!}
    ```
    
    ## 🔬 `File` 🔢
    
    ✍ 📁 🔢 🎏 🌌 👆 🔜 `Body` ⚖️ `Form`:
    
    ```Python hl_lines="7"
    {!../../../docs_src/request_files/tutorial001.py!}
    ```
    
    !!! info
        `File` 🎓 👈 😖 🔗 ⚪️➡️ `Form`.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 6.6K bytes
    - Viewed (0)
  5. docs/ko/docs/tutorial/request-files.md

    ## `File` 임포트
    
    `fastapi` 에서 `File` 과 `UploadFile` 을 임포트 합니다:
    
    ```Python hl_lines="1"
    {!../../../docs_src/request_files/tutorial001.py!}
    ```
    
    ## `File` 매개변수 정의
    
    `Body` 및 `Form` 과 동일한 방식으로 파일의 매개변수를 생성합니다:
    
    ```Python hl_lines="7"
    {!../../../docs_src/request_files/tutorial001.py!}
    ```
    
    !!! info "정보"
        `File` 은 `Form` 으로부터 직접 상속된 클래스입니다.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 8.1K bytes
    - Viewed (0)
  6. docs/zh/docs/tutorial/request-forms.md

    ```
    
    ## 定义 `Form` 参数
    
    创建表单(`Form`)参数的方式与 `Body` 和 `Query` 一样:
    
    ```Python hl_lines="7"
    {!../../../docs_src/request_forms/tutorial001.py!}
    ```
    
    例如,OAuth2 规范的 "密码流" 模式规定要通过表单字段发送 `username` 和 `password`。
    
    <abbr title="specification">该规范</abbr>要求字段必须命名为 `username` 和 `password`,并通过表单字段发送,不能用 JSON。
    
    使用 `Form` 可以声明与 `Body` (及 `Query`、`Path`、`Cookie`)相同的元数据和验证。
    
    !!! info "说明"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 2.2K bytes
    - Viewed (0)
  7. docs/ja/docs/tutorial/schema-extra-example.md

    ## `Field`の追加引数
    
    後述する`Field`、`Path`、`Query`、`Body`などでは、任意の引数を関数に渡すことでJSON Schemaの追加情報を宣言することもできます:
    
    ```Python hl_lines="4 10 11 12 13"
    {!../../../docs_src/schema_extra_example/tutorial002.py!}
    ```
    
    !!! warning "注意"
        これらの追加引数が渡されても、文書化のためのバリデーションは追加されず、注釈だけが追加されることを覚えておいてください。
    
    ## `Body`の追加引数
    
    追加情報を`Field`に渡すのと同じように、`Path`、`Query`、`Body`などでも同じことができます。
    
    例えば、`Body`にボディリクエストの`example`を渡すことができます:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 3K bytes
    - Viewed (0)
  8. docs/em/docs/advanced/openapi-callbacks.md

    ```Python hl_lines="3  25"
    {!../../../docs_src/openapi_callbacks/tutorial001.py!}
    ```
    
    ### ✍ ⏲ *➡ 🛠️*
    
    ✍ ⏲ *➡ 🛠️* ⚙️ 🎏 `APIRouter` 👆 ✍ 🔛.
    
    ⚫️ 🔜 👀 💖 😐 FastAPI *➡ 🛠️*:
    
    * ⚫️ 🔜 🎲 ✔️ 📄 💪 ⚫️ 🔜 📨, ✅ `body: InvoiceEvent`.
    *  &amp; ⚫️ 💪 ✔️ 📄 📨 ⚫️ 🔜 📨, ✅ `response_model=InvoiceEventReceived`.
    
    ```Python hl_lines="16-18  21-22  28-32"
    {!../../../docs_src/openapi_callbacks/tutorial001.py!}
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 6.6K bytes
    - Viewed (0)
  9. docs/en/docs/advanced/dataclasses.md

    3. The `Author` dataclass includes a list of `Item` dataclasses.
    
    4. The `Author` dataclass is used as the `response_model` parameter.
    
    5. You can use other standard type annotations with dataclasses as the request body.
    
        In this case, it's a list of `Item` dataclasses.
    
    6. Here we are returning a dictionary that contains `items` which is a list of dataclasses.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  10. docs/en/docs/tutorial/request-forms-and-files.md

    And you can declare some of the files as `bytes` and some as `UploadFile`.
    
    !!! warning
        You can declare multiple `File` and `Form` parameters in a *path operation*, but you can't also declare `Body` fields that you expect to receive as JSON, as the request will have the body encoded using `multipart/form-data` instead of `application/json`.
    
        This is not a limitation of **FastAPI**, it's part of the HTTP protocol.
    
    ## Recap
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 2K bytes
    - Viewed (0)
Back to top