Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 41 - 50 of 81 for response_class (0.1 seconds)

  1. docs/de/docs/advanced/custom-response.md

    {* ../../docs_src/response_model/tutorial001_01_py310.py ln[15:17] hl[16] *}
    
    ## HTML-Response { #html-response }
    
    Um eine Response mit HTML direkt von **FastAPI** zurückzugeben, verwenden Sie `HTMLResponse`.
    
    * Importieren Sie `HTMLResponse`.
    * Übergeben Sie `HTMLResponse` als den Parameter `response_class` Ihres *Pfadoperation-Dekorators*.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 17:58:09 GMT 2026
    - 12.5K bytes
    - Click Count (0)
  2. docs/zh/docs/advanced/custom-response.md

    如果你在 `response_class` 中声明了一个 JSON 媒体类型(`application/json`)的类(比如 `JSONResponse`),你返回的数据会使用你在 *路径操作装饰器* 中声明的任意 Pydantic `response_model` 自动转换(和过滤)。但数据不会由 Pydantic 序列化为 JSON 字节;而是先用 `jsonable_encoder` 转换后传给 `JSONResponse`,由它使用 Python 标准 JSON 库序列化为字节。
    
    ### JSON 性能 { #json-performance }
    
    简而言之,如果你想要获得最大性能,请使用[响应模型](../tutorial/response-model.md),并且不要在 *路径操作装饰器* 中声明 `response_class`。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 10.4K bytes
    - Click Count (0)
  3. docs/ru/docs/advanced/custom-response.md

    {* ../../docs_src/response_model/tutorial001_01_py310.py ln[15:17] hl[16] *}
    
    ## HTML-ответ { #html-response }
    
    Чтобы вернуть ответ с HTML напрямую из **FastAPI**, используйте `HTMLResponse`.
    
    - Импортируйте `HTMLResponse`.
    - Передайте `HTMLResponse` в параметр `response_class` вашего декоратора операции пути.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 17:56:20 GMT 2026
    - 17.6K bytes
    - Click Count (0)
  4. docs/uk/docs/advanced/custom-response.md

    {* ../../docs_src/response_model/tutorial001_01_py310.py ln[15:17] hl[16] *}
    
    ## HTML-відповідь { #html-response }
    
    Щоб повернути відповідь із HTML безпосередньо з **FastAPI**, використовуйте `HTMLResponse`.
    
    - Імпортуйте `HTMLResponse`.
    - Передайте `HTMLResponse` як параметр `response_class` вашого декоратора операції шляху.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:27:41 GMT 2026
    - 17K bytes
    - Click Count (0)
  5. docs/fr/docs/advanced/custom-response.md

    {* ../../docs_src/response_model/tutorial001_01_py310.py ln[15:17] hl[16] *}
    
    ## Réponse HTML { #html-response }
    
    Pour renvoyer une réponse avec du HTML directement depuis **FastAPI**, utilisez `HTMLResponse`.
    
    - Importez `HTMLResponse`.
    - Passez `HTMLResponse` comme paramètre `response_class` de votre *décorateur de chemin d'accès*.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:37:13 GMT 2026
    - 12.3K bytes
    - Click Count (0)
  6. docs/pt/docs/advanced/custom-response.md

    {* ../../docs_src/response_model/tutorial001_01_py310.py ln[15:17] hl[16] *}
    
    ## Resposta HTML { #html-response }
    
    Para retornar uma resposta com HTML diretamente do **FastAPI**, utilize `HTMLResponse`.
    
    * Importe `HTMLResponse`.
    * Passe `HTMLResponse` como o parâmetro de `response_class` do seu *decorador de operação de rota*.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:20:43 GMT 2026
    - 12K bytes
    - Click Count (0)
  7. docs_src/custom_response/tutorial006b_py310.py

    from fastapi import FastAPI
    from fastapi.responses import RedirectResponse
    
    app = FastAPI()
    
    
    @app.get("/fastapi", response_class=RedirectResponse)
    async def redirect_fastapi():
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 220 bytes
    - Click Count (0)
  8. docs/ru/docs/advanced/stream-data.md

    Аналогично можно стримить **видео** или **аудио** — данные могут даже генерироваться по мере обработки и отправки.
    
    ## «`StreamingResponse` с `yield`» { #a-streamingresponse-with-yield }
    
    Если вы укажете `response_class=StreamingResponse` в своей *функции-обработчике пути*, вы можете использовать `yield`, чтобы по очереди отправлять каждый чанк данных.
    
    {* ../../docs_src/stream_data/tutorial001_py310.py ln[1:23] hl[20,23] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 17:56:20 GMT 2026
    - 8.9K bytes
    - Click Count (0)
  9. docs/es/docs/advanced/stream-data.md

    También podrías transmitir video o audio de esta manera; incluso podría generarse mientras lo procesas y lo envías.
    
    ## Un `StreamingResponse` con `yield` { #a-streamingresponse-with-yield }
    
    Si declaras un `response_class=StreamingResponse` en tu *path operation function*, puedes usar `yield` para enviar cada bloque de datos a su vez.
    
    {* ../../docs_src/stream_data/tutorial001_py310.py ln[1:23] hl[20,23] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:12:26 GMT 2026
    - 5.7K bytes
    - Click Count (0)
  10. tests/test_response_class_no_mediatype.py

        media_type = "application/vnd.api+json"
    
    
    class Error(BaseModel):
        status: str
        title: str
    
    
    class JsonApiError(BaseModel):
        errors: list[Error]
    
    
    @app.get(
        "/a",
        response_class=Response,
        responses={500: {"description": "Error", "model": JsonApiError}},
    )
    async def a():
        pass  # pragma: no cover
    
    
    @app.get("/b", responses={500: {"description": "Error", "model": Error}})
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Feb 08 10:18:38 GMT 2026
    - 3.6K bytes
    - Click Count (0)
Back to Top