Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for callback_url (0.06 sec)

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

    ## 常规 **FastAPI** 应用
    
    添加回调前,首先看下常规 API 应用是什么样子。
    
    常规 API 应用包含接收 `Invoice` 请求体的*路径操作*,还有包含回调 URL 的查询参数 `callback_url`。
    
    这部分代码很常规,您对绝大多数代码应该都比较熟悉了:
    
    {* ../../docs_src/openapi_callbacks/tutorial001.py hl[10:14,37:54] *}
    
    /// tip | 提示
    
    `callback_url` 查询参数使用 Pydantic 的 <a href="https://pydantic-docs.helpmanual.io/usage/types/#urls" class="external-link" target="_blank">URL</a> 类型。
    
    ///
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  2. tests/test_additional_responses_custom_model_in_callback.py

    app = FastAPI()
    
    callback_router = APIRouter(default_response_class=JSONResponse)
    
    
    @callback_router.get(
        "{$callback_url}/callback/", responses={400: {"model": CustomModel}}
    )
    def callback_route():
        pass  # pragma: no cover
    
    
    @app.post("/", callbacks=callback_router.routes)
    def main_route(callback_url: HttpUrl):
        pass  # pragma: no cover
    
    
    client = TestClient(app)
    
    
    def test_openapi_schema():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 5.8K bytes
    - Viewed (0)
  3. tests/test_sub_callbacks.py

    
    @invoices_callback_router.post(
        "{$callback_url}/invoices/{$request.body.id}", response_model=InvoiceEventReceived
    )
    def invoice_notification(body: InvoiceEvent):
        pass  # pragma: nocover
    
    
    class Event(BaseModel):
        name: str
        total: float
    
    
    events_callback_router = APIRouter()
    
    
    @events_callback_router.get("{$callback_url}/events/{$request.body.title}")
    def event_callback(event: Event):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 12.9K bytes
    - Viewed (0)
  4. docs/es/docs/advanced/openapi-callbacks.md

    Tendrá una *path operation* que recibirá un cuerpo `Invoice`, y un parámetro de query `callback_url` que contendrá la URL para el callback.
    
    Esta parte es bastante normal, probablemente ya estés familiarizado con la mayor parte del código:
    
    {* ../../docs_src/openapi_callbacks/tutorial001_py310.py hl[7:11,34:51] *}
    
    /// tip | Consejo
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Dec 16 16:33:45 UTC 2025
    - 8.3K bytes
    - Viewed (0)
  5. docs/ru/docs/advanced/openapi-callbacks.md

    В нём будет *операция пути*, которая получит тело запроса `Invoice`, и query-параметр `callback_url`, содержащий URL для обратного вызова.
    
    Эта часть вполне обычна, большая часть кода вам уже знакома:
    
    {* ../../docs_src/openapi_callbacks/tutorial001_py310.py hl[7:11,34:51] *}
    
    /// tip | Совет
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Thu Dec 11 21:25:03 UTC 2025
    - 12.7K bytes
    - Viewed (0)
  6. docs/de/docs/advanced/openapi-callbacks.md

    Dieser Teil ist ziemlich normal, der größte Teil des Codes ist Ihnen wahrscheinlich bereits bekannt:
    
    {* ../../docs_src/openapi_callbacks/tutorial001_py310.py hl[7:11,34:51] *}
    
    /// tip | Tipp
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 10 13:54:34 UTC 2025
    - 9.2K bytes
    - Viewed (0)
  7. docs_src/openapi_callbacks/tutorial001_py310.py

    
    invoices_callback_router = APIRouter()
    
    
    @invoices_callback_router.post(
        "{$callback_url}/invoices/{$request.body.id}", response_model=InvoiceEventReceived
    )
    def invoice_notification(body: InvoiceEvent):
        pass
    
    
    @app.post("/invoices/", callbacks=invoices_callback_router.routes)
    def create_invoice(invoice: Invoice, callback_url: HttpUrl | None = None):
        """
        Create an invoice.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 10 08:55:32 UTC 2025
    - 1.3K bytes
    - Viewed (0)
  8. docs/en/docs/advanced/openapi-callbacks.md

    It will have a *path operation* that will receive an `Invoice` body, and a query parameter `callback_url` that will contain the URL for the callback.
    
    This part is pretty normal, most of the code is probably already familiar to you:
    
    {* ../../docs_src/openapi_callbacks/tutorial001_py310.py hl[7:11,34:51] *}
    
    /// tip
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 10 08:55:32 UTC 2025
    - 8K bytes
    - Viewed (0)
  9. docs/pt/docs/advanced/openapi-callbacks.md

    Ele terá uma *operação de rota* que receberá um corpo `Invoice`, e um parâmetro de consulta `callback_url` que conterá a URL para o callback.
    
    Essa parte é bastante normal, a maior parte do código provavelmente já é familiar para você:
    
    {* ../../docs_src/openapi_callbacks/tutorial001_py310.py hl[7:11,34:51] *}
    
    /// tip | Dica
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Dec 16 20:32:40 UTC 2025
    - 8.4K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_openapi_callbacks/test_tutorial001.py

                                        {"type": "null"},
                                    ],
                                    "title": "Callback Url",
                                },
                                "name": "callback_url",
                                "in": "query",
                            }
                        ],
                        "requestBody": {
                            "content": {
                                "application/json": {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 8.6K bytes
    - Viewed (0)
Back to top