- Sort Score
- Num 10 results
- Language All
Results 51 - 60 of 81 for response_class (0.08 seconds)
-
tests/test_response_code_no_body.py
class Error(BaseModel): status: str title: str class JsonApiError(BaseModel): errors: list[Error] @app.get( "/a", status_code=204, response_class=JsonApiResponse, responses={500: {"description": "Error", "model": JsonApiError}}, ) async def a(): pass @app.get("/b", responses={204: {"description": "No Content"}}) async def b():
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Feb 08 10:18:38 GMT 2026 - 3.5K bytes - Click Count (0) -
docs/tr/docs/advanced/stream-data.md
Bu şekilde **video** veya **ses** de akıtabilirsiniz; hatta işledikçe üretilip gönderilebilir. ## `yield` ile bir `StreamingResponse` { #a-streamingresponse-with-yield } *Path operation function* içinde `response_class=StreamingResponse` belirtirseniz, her veri parçasını sırayla göndermek için `yield` kullanabilirsiniz. {* ../../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:51:35 GMT 2026 - 5.8K bytes - Click Count (0) -
docs_src/custom_response/tutorial001_py310.py
from fastapi import FastAPI from fastapi.responses import UJSONResponse app = FastAPI() @app.get("/items/", response_class=UJSONResponse) async def read_items():
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 197 bytes - Click Count (0) -
docs_src/templates/tutorial001_py310.py
app = FastAPI() app.mount("/static", StaticFiles(directory="static"), name="static") templates = Jinja2Templates(directory="templates") @app.get("/items/{id}", response_class=HTMLResponse) async def read_item(request: Request, id: str): return templates.TemplateResponse( request=request, name="item.html", context={"id": id}
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 521 bytes - Click Count (0) -
tests/test_additional_responses_custom_validationerror.py
class Error(BaseModel): status: str title: str class JsonApiError(BaseModel): errors: list[Error] @app.get( "/a/{id}", response_class=JsonApiResponse, responses={422: {"description": "Error", "model": JsonApiError}}, ) async def a(id): pass # pragma: no cover client = TestClient(app) def test_openapi_schema():
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Feb 08 10:18:38 GMT 2026 - 3.2K bytes - Click Count (0) -
docs/de/docs/advanced/stream-data.md
## Eine `StreamingResponse` mit `yield` { #a-streamingresponse-with-yield } Wenn Sie in Ihrer Pfadoperation-Funktion ein `response_class=StreamingResponse` deklarieren, können Sie `yield` verwenden, um nacheinander jeden Datenchunk zu senden. {* ../../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:48:21 GMT 2026 - 6K bytes - Click Count (0) -
docs/pt/docs/advanced/stream-data.md
Você também pode transmitir vídeo ou áudio desta forma; pode até ser gerado enquanto você processa e envia. ## Um `StreamingResponse` com `yield` { #a-streamingresponse-with-yield } Se você declarar `response_class=StreamingResponse` na sua função de operação de rota, você pode usar `yield` para enviar cada bloco de dados em sequência. {* ../../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:20:13 GMT 2026 - 5.7K bytes - Click Count (0) -
docs/uk/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 18:25:54 GMT 2026 - 8.5K bytes - Click Count (0) -
tests/test_additional_responses_response_class.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=JsonApiResponse, 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.8K bytes - Click Count (0) -
docs/fr/docs/advanced/stream-data.md
## Utiliser une `StreamingResponse` avec `yield` { #a-streamingresponse-with-yield } Si vous déclarez un `response_class=StreamingResponse` dans votre *fonction de chemin d'accès*, vous pouvez utiliser `yield` pour envoyer chaque bloc de données à son tour. {* ../../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:33:45 GMT 2026 - 6.2K bytes - Click Count (0)