Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for body (0.41 sec)

  1. docs/en/docs/advanced/openapi-callbacks.md

    To create the callback *path operation* use the same `APIRouter` you created above.
    
    It should look just like a normal FastAPI *path operation*:
    
    * It should probably have a declaration of the body it should receive, e.g. `body: InvoiceEvent`.
    * And it could also have a declaration of the response it should return, e.g. `response_model=InvoiceEventReceived`.
    
    ```Python hl_lines="16-18  21-22  28-32"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  2. docs/zh/docs/advanced/openapi-callbacks.md

    首先,新建包含一些用于回调的 `APIRouter`。
    
    ```Python hl_lines="5  26"
    {!../../../docs_src/openapi_callbacks/tutorial001.py!}
    ```
    
    ### 创建回调*路径操作*
    
    创建回调*路径操作*也使用之前创建的 `APIRouter`。
    
    它看起来和常规 FastAPI *路径操作*差不多:
    
    * 声明要接收的请求体,例如,`body: InvoiceEvent`
    * 还要声明要返回的响应,例如,`response_model=InvoiceEventReceived`
    
    ```Python hl_lines="17-19  22-23  29-33"
    {!../../../docs_src/openapi_callbacks/tutorial001.py!}
    ```
    
    回调*路径操作*与常规*路径操作*有两点主要区别:
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 22:46:28 GMT 2024
    - 6.6K bytes
    - Viewed (0)
  3. docs/de/docs/advanced/openapi-callbacks.md

    ```
    https://www.external.org/events/invoices/2expen51ve
    ```
    
    mit einem JSON-Body, der etwa Folgendes enthält:
    
    ```JSON
    {
        "description": "Payment celebration",
        "paid": true
    }
    ```
    
    und sie würde eine Response von dieser *externen API* mit einem JSON-Body wie dem folgenden erwarten:
    
    ```JSON
    {
        "ok": true
    }
    ```
    
    !!! tip "Tipp"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 20:17:23 GMT 2024
    - 8.8K bytes
    - Viewed (0)
  4. docs/em/docs/advanced/openapi-callbacks.md

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