- Sort Score
- Result 10 results
- Languages All
Results 201 - 210 of 378 for item_2 (0.03 sec)
-
tests/test_tutorial/test_body_nested_models/test_tutorial005.py
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 9.6K bytes - Viewed (0) -
docs_src/handling_errors/tutorial006_py39.py
return await request_validation_exception_handler(request, exc) @app.get("/items/{item_id}") async def read_item(item_id: int): if item_id == 3: raise HTTPException(status_code=418, detail="Nope! I don't like 3.")
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 928 bytes - Viewed (0) -
docs_src/path_params/tutorial001_py39.py
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 138 bytes - Viewed (0) -
docs_src/using_request_directly/tutorial001_py39.py
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 230 bytes - Viewed (0) -
docs/zh/docs/tutorial/path-params.md
这段代码把路径参数 `item_id` 的值传递给路径函数的参数 `item_id`。 运行示例并访问 <a href="http://127.0.0.1:8000/items/foo" class="external-link" target="_blank">http://127.0.0.1:8000/items/foo</a>,可获得如下响应: ```JSON {"item_id":"foo"} ``` ## 声明路径参数的类型 使用 Python 标准类型注解,声明路径操作函数中路径参数的类型。 {* ../../docs_src/path_params/tutorial002.py hl[7] *} 本例把 `item_id` 的类型声明为 `int`。 /// check | 检查
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sun Dec 15 16:43:19 UTC 2024 - 7.4K bytes - Viewed (0) -
docs/pt/docs/tutorial/path-params.md
{* ../../docs_src/path_params/tutorial001_py39.py hl[6:7] *} O valor do parâmetro de path `item_id` será passado para a sua função como o argumento `item_id`. Então, se você executar este exemplo e acessar <a href="http://127.0.0.1:8000/items/foo" class="external-link" target="_blank">http://127.0.0.1:8000/items/foo</a>, você verá uma resposta: ```JSON {"item_id":"foo"} ``` ## Parâmetros de path com tipos { #path-parameters-with-types }Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 9.8K bytes - Viewed (0) -
tests/test_tutorial/test_query_params_str_validations/test_tutorial001.py
response = client.get("/items/") assert response.status_code == 200 assert response.json() == {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} def test_query_params_str_validations_q_empty_str(client: TestClient): response = client.get("/items/", params={"q": ""}) assert response.status_code == 200 assert response.json() == {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 4.1K bytes - Viewed (0) -
docs_src/query_params/tutorial006_py39.py
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 301 bytes - Viewed (0) -
docs_src/path_params_numeric_validations/tutorial005_py39.py
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 298 bytes - Viewed (0) -
docs_src/body_multiple_params/tutorial005_py310.py
from fastapi import Body, FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: str | None = None price: float tax: float | None = None @app.put("/items/{item_id}") async def update_item(item_id: int, item: Item = Body(embed=True)): results = {"item_id": item_id, "item": item}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri May 13 23:38:22 UTC 2022 - 369 bytes - Viewed (0)