- Sort Score
- Num 10 results
- Language All
Results 71 - 80 of 981 for tutorial002_py310 (0.12 seconds)
-
docs/en/docs/advanced/response-headers.md
You can declare a parameter of type `Response` in your *path operation function* (as you can do for cookies). And then you can set headers in that *temporal* response object. {* ../../docs_src/response_headers/tutorial002_py310.py hl[1, 7:8] *} And then you can return any object you need, as you normally would (a `dict`, a database model, etc).Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 2.2K bytes - Click Count (0) -
docs/zh/docs/how-to/configure-swagger-ui.md
{* ../../docs_src/configure_swagger_ui/tutorial001_py310.py hl[3] *} ...在此之后,Swagger UI 将不会高亮代码: <img src="/img/tutorial/extending-openapi/image03.png"> ## 改变主题 { #change-the-theme } 同样地,你也可以通过设置键 `"syntaxHighlight.theme"` 来设置语法高亮主题(注意中间有一个点): {* ../../docs_src/configure_swagger_ui/tutorial002_py310.py hl[3] *} 这个配置会改变语法高亮主题:Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 2.7K bytes - Click Count (0) -
docs/zh-hant/docs/tutorial/path-operation-configuration.md
## 摘要與描述 { #summary-and-description } 你可以加入 `summary` 與 `description`: {* ../../docs_src/path_operation_configuration/tutorial003_py310.py hl[17:18] *} ## 從 docstring 取得描述 { #description-from-docstring } 由於描述常常較長、跨越多行,你可以在函式的 <dfn title="用於文件的多行字串,作為函式內的第一個運算式(不賦值給任何變數)">文件字串(docstring)</dfn> 中宣告「路徑操作」的描述,**FastAPI** 會從那裡讀取。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 3.8K bytes - Click Count (0) -
docs/en/docs/advanced/middleware.md
{* ../../docs_src/advanced_middleware/tutorial001_py310.py hl[2,6] *} ## `TrustedHostMiddleware` { #trustedhostmiddleware } Enforces that all incoming requests have a correctly set `Host` header, in order to guard against HTTP Host Header attacks. {* ../../docs_src/advanced_middleware/tutorial002_py310.py hl[2,6:8] *} The following arguments are supported:Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 4.1K bytes - Click Count (0) -
docs/en/docs/tutorial/server-sent-events.md
{* ../../docs_src/server_sent_events/tutorial001_py310.py ln[1:25] hl[4,22] *} Each yielded item is encoded as JSON and sent in the `data:` field of an SSE event. If you declare the return type as `AsyncIterable[Item]`, FastAPI will use it to **validate**, **document**, and **serialize** the data using 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: Thu Mar 05 18:13:19 GMT 2026 - 4.6K bytes - Click Count (0) -
docs/en/docs/advanced/dataclasses.md
/// ## Dataclasses in `response_model` { #dataclasses-in-response-model } You can also use `dataclasses` in the `response_model` parameter: {* ../../docs_src/dataclasses_/tutorial002_py310.py hl[1,6:12,18] *} The dataclass will be automatically converted to a Pydantic dataclass. This way, its schema will show up in the API docs user interface: <img src="/img/tutorial/dataclasses/image01.png">Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 4K bytes - Click Count (0) -
docs/zh/docs/advanced/response-cookies.md
# 响应Cookies { #response-cookies } ## 使用 `Response` 参数 { #use-a-response-parameter } 你可以在 *路径操作函数* 中定义一个类型为 `Response` 的参数,这样你就可以在这个临时响应对象中设置cookie了。 {* ../../docs_src/response_cookies/tutorial002_py310.py hl[1, 8:9] *} 而且你还可以根据你的需要响应不同的对象,比如常用的 `dict`,数据库model等。 如果你定义了 `response_model`,程序会自动根据`response_model`来过滤和转换你响应的对象。 **FastAPI** 会使用这个 *临时* 响应对象去装在这些cookies信息 (同样还有headers和状态码等信息), 最终会将这些信息和通过`response_model`转化过的数据合并到最终的响应里。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 2.1K bytes - Click Count (0) -
docs/en/docs/tutorial/response-status-code.md
Let's see the previous example again: {* ../../docs_src/response_status_code/tutorial001_py310.py hl[6] *} `201` is the status code for "Created". But you don't have to memorize what each of these codes mean. You can use the convenience variables from `fastapi.status`. {* ../../docs_src/response_status_code/tutorial002_py310.py hl[1,6] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 3.9K bytes - Click Count (0) -
docs/ko/docs/advanced/path-operation-advanced-configuration.md
{* ../../docs_src/path_operation_advanced_configuration/tutorial001_py310.py hl[6] *} ### *경로 처리 함수* 이름을 operationId로 사용하기 { #using-the-path-operation-function-name-as-the-operationid } API의 함수 이름을 `operationId`로 사용하고 싶다면, 모든 API를 순회하면서 `APIRoute.name`을 사용해 각 *경로 처리*의 `operation_id`를 덮어쓸 수 있습니다. 모든 *경로 처리*를 추가한 뒤에 수행해야 합니다. {* ../../docs_src/path_operation_advanced_configuration/tutorial002_py310.py hl[2, 12:21, 24] *} /// tip | 팁Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:06:26 GMT 2026 - 7.6K bytes - Click Count (0) -
docs/en/docs/advanced/path-operation-advanced-configuration.md
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 7.1K bytes - Click Count (0)