- Sort Score
- Num 10 results
- Language All
Results 101 - 110 of 980 for tutorial007_py310 (0.12 seconds)
-
docs/fr/docs/tutorial/handling-errors.md
Pour renvoyer au client des réponses HTTP avec des erreurs, vous utilisez `HTTPException`. ### Importer `HTTPException` { #import-httpexception } {* ../../docs_src/handling_errors/tutorial001_py310.py hl[1] *} ### Lever une `HTTPException` dans votre code { #raise-an-httpexception-in-your-code } `HTTPException` est une exception Python normale avec des données supplémentaires pertinentes pour les API.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:37:13 GMT 2026 - 10K bytes - Click Count (0) -
docs/uk/docs/tutorial/server-sent-events.md
{* ../../docs_src/server_sent_events/tutorial001_py310.py ln[1:25] hl[4,22] *} Кожен елемент, повернений через `yield`, кодується як JSON і надсилається в полі `data:` події SSE. Якщо ви оголосите тип повернення як `AsyncIterable[Item]`, FastAPI використає його, щоб **перевіряти**, **документувати** і **серіалізувати** дані за допомогою Pydantic. {* ../../docs_src/server_sent_events/tutorial001_py310.py ln[1:25] hl[10:12,23] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:25:54 GMT 2026 - 7.1K bytes - Click Count (0) -
docs/tr/docs/tutorial/server-sent-events.md
{* ../../docs_src/server_sent_events/tutorial001_py310.py ln[1:25] hl[4,22] *} Yield edilen her öğe JSON olarak kodlanır ve bir SSE olayının `data:` alanında gönderilir. Dönüş tipini `AsyncIterable[Item]` olarak bildirirseniz, FastAPI bunu Pydantic ile veriyi **doğrulamak**, **belgelemek** ve **serileştirmek** için kullanır. {* ../../docs_src/server_sent_events/tutorial001_py310.py ln[1:25] hl[10:12,23] *} /// tip | İpucuCreated: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:51:35 GMT 2026 - 5.1K bytes - Click Count (0) -
docs/ru/docs/tutorial/server-sent-events.md
{* ../../docs_src/server_sent_events/tutorial001_py310.py ln[28:31] hl[29] *} ### Без объявленного типа возврата { #no-return-type } Вы также можете опустить тип возврата. FastAPI использует [`jsonable_encoder`](./encoder.md) для преобразования данных и их отправки. {* ../../docs_src/server_sent_events/tutorial001_py310.py ln[34:37] hl[35] *} ## `ServerSentEvent` { #serversentevent }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 17:56:20 GMT 2026 - 7.4K bytes - Click Count (0) -
docs/fr/docs/tutorial/server-sent-events.md
{* ../../docs_src/server_sent_events/tutorial001_py310.py ln[1:25] hl[4,22] *} Chaque élément produit avec `yield` est encodé en JSON et envoyé dans le champ `data:` d’un événement SSE. Si vous déclarez le type de retour comme `AsyncIterable[Item]`, FastAPI l’utilisera pour **valider**, **documenter** et **sérialiser** les données avec Pydantic. {* ../../docs_src/server_sent_events/tutorial001_py310.py ln[1:25] hl[10:12,23] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:33:45 GMT 2026 - 5.3K bytes - Click Count (0) -
docs/zh/docs/tutorial/handling-errors.md
{* ../../docs_src/handling_errors/tutorial002_py310.py hl[14] *} ## 安装自定义异常处理器 { #install-custom-exception-handlers } 可以使用[与 Starlette 相同的异常处理工具](https://www.starlette.dev/exceptions/)添加自定义异常处理器。 假设有一个自定义异常 `UnicornException`(你自己或你使用的库可能会 `raise` 它)。 并且你希望用 FastAPI 在全局处理该异常。 此时,可以用 `@app.exception_handler()` 添加自定义异常处理器: {* ../../docs_src/handling_errors/tutorial003_py310.py hl[5:7,13:18,24] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 8.2K bytes - Click Count (0) -
docs/zh-hant/docs/tutorial/server-sent-events.md
從 `fastapi.sse` 匯入 `EventSourceResponse`: {* ../../docs_src/server_sent_events/tutorial001_py310.py ln[1:25] hl[4,22] *} 每個 `yield` 的項目都會以 JSON 編碼並放在 SSE 事件的 `data:` 欄位中送出。 如果你把回傳型別宣告為 `AsyncIterable[Item]`,FastAPI 會用它來透過 Pydantic 進行**驗證**、**文件化**與**序列化**。 {* ../../docs_src/server_sent_events/tutorial001_py310.py ln[1:25] hl[10:12,23] *} /// tip 因為 Pydantic 會在 **Rust** 端進行序列化,如果你有宣告回傳型別,效能會比未宣告時高很多。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:33:04 GMT 2026 - 4.6K bytes - Click Count (0) -
docs/es/docs/tutorial/handling-errors.md
## Usa `HTTPException` { #use-httpexception } Para devolver responses HTTP con errores al cliente, usa `HTTPException`. ### Importa `HTTPException` { #import-httpexception } {* ../../docs_src/handling_errors/tutorial001_py310.py hl[1] *} ### Lanza un `HTTPException` en tu código { #raise-an-httpexception-in-your-code } `HTTPException` es una excepción de Python normal con datos adicionales relevantes para APIs.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:15:55 GMT 2026 - 9.6K bytes - Click Count (0) -
docs/pt/docs/tutorial/handling-errors.md
## Use o `HTTPException` { #use-httpexception } Para retornar ao cliente *responses* HTTP com erros, use o `HTTPException`. ### Import `HTTPException` { #import-httpexception } {* ../../docs_src/handling_errors/tutorial001_py310.py hl[1] *} ### Lance o `HTTPException` no seu código { #raise-an-httpexception-in-your-code }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:20:43 GMT 2026 - 10.1K bytes - Click Count (0) -
docs/en/docs/tutorial/handling-errors.md
## Use `HTTPException` { #use-httpexception } To return HTTP responses with errors to the client you use `HTTPException`. ### Import `HTTPException` { #import-httpexception } {* ../../docs_src/handling_errors/tutorial001_py310.py hl[1] *} ### Raise an `HTTPException` in your code { #raise-an-httpexception-in-your-code } `HTTPException` is a normal Python exception with additional data relevant for APIs.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 8.9K bytes - Click Count (0)