- Sort Score
- Num 10 results
- Language All
Results 11 - 20 of 1,139 for docs_src (0.24 seconds)
-
docs/en/docs/advanced/custom-response.md
{* ../../docs_src/response_model/tutorial001_01_py310.py ln[15:17] hl[16] *} ## HTML Response { #html-response } To return a response with HTML directly from **FastAPI**, use `HTMLResponse`. * Import `HTMLResponse`. * Pass `HTMLResponse` as the parameter `response_class` of your *path operation decorator*. {* ../../docs_src/custom_response/tutorial002_py310.py hl[2,7] *} /// infoCreated: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 11K bytes - Click Count (0) -
docs/zh/docs/tutorial/sql-databases.md
{* ../../docs_src/sql_databases/tutorial001_an_py310.py ln[21:22] hl[21:22] *} ### 创建会话(Session)依赖项 { #create-a-session-dependency } **`Session`** 会存储**内存中的对象**并跟踪数据中所需更改的内容,然后它**使用 `engine`** 与数据库进行通信。 我们会使用 `yield` 创建一个 FastAPI **依赖项**,为每个请求提供一个新的 `Session`。这确保我们每个请求使用一个单独的会话。🤓 然后我们创建一个 `Annotated` 的依赖项 `SessionDep` 来简化其他也会用到此依赖的代码。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 15.4K bytes - Click Count (0) -
docs/en/docs/tutorial/query-params.md
# Query Parameters { #query-parameters } When you declare other function parameters that are not part of the path parameters, they are automatically interpreted as "query" parameters. {* ../../docs_src/query_params/tutorial001_py310.py hl[9] *} The query is the set of key-value pairs that go after the `?` in a URL, separated by `&` characters. For example, in the URL: ``` http://127.0.0.1:8000/items/?skip=0&limit=10 ```Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 4.5K bytes - Click Count (0) -
docs/en/docs/python-types.md
Check this function, it already has type hints: {* ../../docs_src/python_types/tutorial003_py310.py hl[1] *} Because the editor knows the types of the variables, you don't only get completion, you also get error checks: <img src="/img/python-types/image04.png"> Now you know that you have to fix it, convert `age` to a string with `str(age)`: {* ../../docs_src/python_types/tutorial004_py310.py hl[2] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 11K bytes - Click Count (0) -
docs/ko/docs/tutorial/metadata.md
예를 들어, 이를 `/api/v1/openapi.json`에서 제공하도록 설정하려면: {* ../../docs_src/metadata/tutorial002_py310.py hl[3] *} OpenAPI 스키마를 완전히 비활성화하려면 `openapi_url=None`으로 설정할 수 있으며, 이를 사용하여 문서화 사용자 인터페이스도 비활성화됩니다. ## 문서화 URL { #docs-urls } 포함된 두 가지 문서화 사용자 인터페이스를 설정할 수 있습니다: * **Swagger UI**: `/docs`에서 제공됩니다. * `docs_url` 매개변수로 URL을 설정할 수 있습니다. * `docs_url=None`으로 설정하여 비활성화할 수 있습니다. * **ReDoc**: `/redoc`에서 제공됩니다.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:06:26 GMT 2026 - 6.6K bytes - Click Count (0) -
docs/zh/docs/advanced/path-operation-advanced-configuration.md
务必确保每个操作的 `operation_id` 都是唯一的。 {* ../../docs_src/path_operation_advanced_configuration/tutorial001_py310.py hl[6] *} ### 使用 *路径操作函数* 的函数名作为 operationId { #using-the-path-operation-function-name-as-the-operationid } 如果你想用 API 的函数名作为 `operationId`,你可以遍历所有路径操作,并使用它们的 `APIRoute.name` 重写每个 *路径操作* 的 `operation_id`。 你应该在添加了所有 *路径操作* 之后执行此操作。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 6.7K bytes - Click Count (0) -
docs/zh-hant/docs/advanced/stream-data.md
{* ../../docs_src/stream_data/tutorial002_py310.py ln[6,19:20] hl[20] *} 接著在路徑操作函式中用 `response_class=PNGStreamingResponse` 使用這個新類別: {* ../../docs_src/stream_data/tutorial002_py310.py ln[23:27] hl[23] *} ### 模擬檔案 { #simulate-a-file } 此範例中我們用 `io.BytesIO` 模擬檔案。它是只存在於記憶體中的類檔案物件,但提供相同的介面。 例如,我們可以像讀取一般檔案一樣,透過迭代來消耗其內容。 {* ../../docs_src/stream_data/tutorial002_py310.py ln[1:27] hl[3,12:13,25] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:33:04 GMT 2026 - 4.9K bytes - Click Count (0) -
docs/en/docs/tutorial/path-params.md
{* ../../docs_src/path_params/tutorial003_py310.py hl[6,11] *} Otherwise, the path for `/users/{user_id}` would match also for `/users/me`, "thinking" that it's receiving a parameter `user_id` with a value of `"me"`. Similarly, you cannot redefine a path operation: {* ../../docs_src/path_params/tutorial003b_py310.py hl[6,11] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 8.8K 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] *} /// tipCreated: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:33:04 GMT 2026 - 4.6K bytes - Click Count (0) -
scripts/tests/test_translation_fixer/test_code_includes/data/translated_doc_number_lt.md
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 08:08:04 GMT 2026 - 240 bytes - Click Count (0)