- Sort Score
- Num 10 results
- Language All
Results 81 - 90 of 802 for tutorial009_py310 (0.2 seconds)
The search processing time has exceeded the limit. The displayed results may be partial.
-
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) -
docs/zh/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:29:48 GMT 2026 - 4.6K bytes - Click Count (0) -
docs/uk/docs/tutorial/response-model.md
{* ../../docs_src/response_model/tutorial003_py310.py hl[9,11,16] *} Тут, хоча наша *функція операції шляху* повертає того самого вхідного користувача, який містить пароль: {* ../../docs_src/response_model/tutorial003_py310.py hl[24] *} ...ми оголосили `response_model` як нашу модель `UserOut`, яка не містить пароля: {* ../../docs_src/response_model/tutorial003_py310.py hl[22] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:27:41 GMT 2026 - 25.2K bytes - Click Count (0) -
docs/ru/docs/tutorial/response-model.md
{* ../../docs_src/response_model/tutorial003_py310.py hl[9,11,16] *} Здесь, хотя *функция-обработчик пути* возвращает тот же входной объект пользователя, содержащий пароль: {* ../../docs_src/response_model/tutorial003_py310.py hl[24] *} ...мы объявили `response_model` как модель `UserOut`, в которой нет пароля: {* ../../docs_src/response_model/tutorial003_py310.py hl[22] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 17:56:20 GMT 2026 - 25.5K bytes - Click Count (0) -
docs/ko/docs/tutorial/handling-errors.md
## `HTTPException` 사용하기 { #use-httpexception } 클라이언트에 오류가 포함된 HTTP 응답을 반환하려면 `HTTPException`을 사용합니다. ### `HTTPException` 가져오기 { #import-httpexception } {* ../../docs_src/handling_errors/tutorial001_py310.py hl[1] *} ### 코드에서 `HTTPException` 발생시키기 { #raise-an-httpexception-in-your-code } `HTTPException`은 API와 관련된 추가 데이터를 가진 일반적인 Python 예외입니다. Python 예외이므로 `return` 하는 것이 아니라 `raise` 합니다.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:06:26 GMT 2026 - 10.2K bytes - Click Count (0) -
docs/ru/docs/tutorial/path-params.md
{* ../../docs_src/path_params/tutorial005_py310.py hl[17] *} #### Получение *значения перечисления* { #get-the-enumeration-value } Можно получить фактическое значение (в данном случае - `str`) с помощью `model_name.value` или в общем случае `your_enum_member.value`: {* ../../docs_src/path_params/tutorial005_py310.py hl[20] *} /// tip | ПодсказкаCreated: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 17:56:20 GMT 2026 - 14K bytes - Click Count (0) -
docs/ko/docs/tutorial/server-sent-events.md
`EventSourceResponse`는 `fastapi.sse`에서 임포트합니다: {* ../../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 | 팁Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:56:39 GMT 2026 - 5.3K bytes - Click Count (0) -
docs/en/docs/tutorial/response-model.md
We can instead create an input model with the plaintext password and an output model without it: {* ../../docs_src/response_model/tutorial003_py310.py hl[9,11,16] *} Here, even though our *path operation function* is returning the same input user that contains the password: {* ../../docs_src/response_model/tutorial003_py310.py hl[24] *} ...we declared the `response_model` to be our model `UserOut`, that doesn't include the password:Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 15.5K bytes - Click Count (0) -
docs/pt/docs/tutorial/response-model.md
{* ../../docs_src/response_model/tutorial003_py310.py hl[9,11,16] *} Aqui, embora nossa *função de operação de rota* esteja retornando o mesmo usuário de entrada que contém a senha: {* ../../docs_src/response_model/tutorial003_py310.py hl[24] *} ...declaramos o `response_model` como nosso modelo `UserOut`, que não inclui a senha: {* ../../docs_src/response_model/tutorial003_py310.py hl[22] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:20:43 GMT 2026 - 16.7K bytes - Click Count (0) -
docs/zh-hant/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:05:38 GMT 2026 - 8.3K bytes - Click Count (0)