- Sort Score
- Num 10 results
- Language All
Results 21 - 30 of 97 for jsonable_encoder (0.08 seconds)
-
docs/en/docs/tutorial/server-sent-events.md
{* ../../docs_src/server_sent_events/tutorial001_py310.py ln[28:31] hl[29] *} ### No Return Type { #no-return-type } You can also omit the return type. FastAPI will use the [`jsonable_encoder`](./encoder.md) to convert the data and send it. {* ../../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 05 18:13:19 GMT 2026 - 4.6K bytes - Click Count (0) -
docs/en/docs/tutorial/stream-json-lines.md
{* ../../docs_src/stream_json_lines/tutorial001_py310.py ln[27:30] hl[28] *} ### No Return Type { #no-return-type } You can also omit the return type. FastAPI will then use the [`jsonable_encoder`](./encoder.md) to convert the data to something that can be serialized to JSON and then send it as JSON Lines. {* ../../docs_src/stream_json_lines/tutorial001_py310.py ln[33:36] hl[34] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 4.3K bytes - Click Count (0) -
docs/zh-hant/docs/advanced/custom-response.md
如果你沒有宣告回應模型,FastAPI 會使用在[JSON 相容編碼器](../tutorial/encoder.md)中解釋的 `jsonable_encoder`,並將結果放進 `JSONResponse`。 如果你宣告的 `response_class` 具有 JSON 的 media type(`application/json`),像 `JSONResponse`,你回傳的資料會自動以你在「路徑操作裝飾器」中宣告的任何 Pydantic `response_model` 進行轉換(與過濾)。但資料不會由 Pydantic 直接序列化成 JSON 位元組;取而代之,會先經由 `jsonable_encoder` 轉換,然後交給 `JSONResponse` 類別,該類別會使用 Python 標準的 JSON 函式庫將其序列化為位元組。 ### JSON 效能 { #json-performance }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 10.3K bytes - Click Count (0) -
docs/zh-hant/docs/tutorial/server-sent-events.md
FastAPI 會確保正確執行,不會阻塞事件迴圈。 由於此函式不是 async,正確的回傳型別是 `Iterable[Item]`: {* ../../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: Fri Mar 20 14:33:04 GMT 2026 - 4.6K bytes - Click Count (0) -
docs/ko/docs/tutorial/server-sent-events.md
이 경우 함수가 async가 아니므로 적절한 반환 타입은 `Iterable[Item]`입니다: {* ../../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 18:56:39 GMT 2026 - 5.3K bytes - Click Count (0) -
docs/en/docs/tutorial/testing.md
Note that the `TestClient` receives data that can be converted to JSON, not Pydantic models. If you have a Pydantic model in your test and you want to send its data to the application during testing, you can use the `jsonable_encoder` described in [JSON Compatible Encoder](encoder.md). /// ## Run it { #run-it } After that, you just need to install `pytest`.
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 5.7K bytes - Click Count (0) -
docs/zh/docs/tutorial/stream-json-lines.md
FastAPI 会确保其正确运行,不会阻塞事件循环。 因为这个函数不是异步的,合适的返回类型是 `Iterable[Item]`: {* ../../docs_src/stream_json_lines/tutorial001_py310.py ln[27:30] hl[28] *} ### 无返回类型 { #no-return-type } 你也可以省略返回类型。此时 FastAPI 会使用 [`jsonable_encoder`](./encoder.md) 将数据转换为可序列化为 JSON 的形式,然后以 JSON Lines 发送。 {* ../../docs_src/stream_json_lines/tutorial001_py310.py ln[33:36] hl[34] *} ## 服务器发送事件(SSE) { #server-sent-events-sse }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:29:48 GMT 2026 - 4.2K bytes - Click Count (0) -
docs/zh-hant/docs/tutorial/stream-json-lines.md
因為這種情況下函式不是 async,正確的回傳型別會是 `Iterable[Item]`: {* ../../docs_src/stream_json_lines/tutorial001_py310.py ln[27:30] hl[28] *} ### 不宣告回傳型別 { #no-return-type } 你也可以省略回傳型別。此時 FastAPI 會使用 [`jsonable_encoder`](./encoder.md) 將資料轉換為可序列化為 JSON 的形式,然後以 JSON Lines 傳送。 {* ../../docs_src/stream_json_lines/tutorial001_py310.py ln[33:36] hl[34] *} ## 伺服器推播事件(SSE) { #server-sent-events-sse }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:33:04 GMT 2026 - 4.2K bytes - Click Count (0) -
docs/zh/docs/tutorial/server-sent-events.md
FastAPI 会确保其正确运行,从而不阻塞事件循环。 由于此时函数不是 async,正确的返回类型应为 `Iterable[Item]`: {* ../../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: Fri Mar 20 14:29:48 GMT 2026 - 4.6K bytes - Click Count (0) -
docs/ja/docs/tutorial/server-sent-events.md
この場合は関数が async ではないため、適切な戻り値の型は `Iterable[Item]` です: {* ../../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 18:55:22 GMT 2026 - 5.8K bytes - Click Count (0)