- Sort Score
- Num 10 results
- Language All
Results 11 - 20 of 274 for head_item (0.1 seconds)
-
docs_src/query_params/tutorial002_py39.py
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 251 bytes - Click Count (0) -
docs/zh/docs/advanced/templates.md
```html Item ID: 42 ``` ### 模板 `url_for` 参数 你还可以在模板内使用 `url_for()`,其参数与*路径操作函数*的参数相同. 所以,该部分: {% raw %} ```jinja <a href="{{ url_for('read_item', id=id) }}"> ``` {% endraw %} ...将生成一个与处理*路径操作函数* `read_item(id=id)`的URL相同的链接 例如。当ID为 `42`时, 会渲染成: ```html <a href="/items/42"> ``` ## 模板与静态文件Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Oct 11 17:48:49 GMT 2025 - 2.7K bytes - Click Count (0) -
docs_src/additional_responses/tutorial001_py39.py
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 506 bytes - Click Count (0) -
docs_src/path_params/tutorial001_py39.py
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 138 bytes - Click Count (0) -
docs/en/docs/advanced/templates.md
So, the section with: {% raw %} ```jinja <a href="{{ url_for('read_item', id=id) }}"> ``` {% endraw %} ...will generate a link to the same URL that would be handled by the *path operation function* `read_item(id=id)`. For example, with an ID of `42`, this would render: ```html <a href="/items/42"> ```Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 3.5K bytes - Click Count (0) -
tests/test_additional_response_extra.py
from fastapi import APIRouter, FastAPI from fastapi.testclient import TestClient router = APIRouter() sub_router = APIRouter() app = FastAPI() @sub_router.get("/") def read_item(): return {"id": "foo"} router.include_router(sub_router, prefix="/items") app.include_router(router) client = TestClient(app) def test_path_operation(): response = client.get("/items/")
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 1.2K bytes - Click Count (0) -
docs_src/additional_responses/tutorial004_py310.py
} app = FastAPI() @app.get( "/items/{item_id}", response_model=Item, responses={**responses, 200: {"content": {"image/png": {}}}}, ) async def read_item(item_id: str, img: bool | None = None): if img: return FileResponse("image.png", media_type="image/png") else:
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 10 08:55:32 GMT 2025 - 669 bytes - Click Count (0) -
docs_src/additional_responses/tutorial003_py39.py
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 837 bytes - Click Count (0) -
docs_src/query_params/tutorial003_py310.py
from fastapi import FastAPI app = FastAPI() @app.get("/items/{item_id}") async def read_item(item_id: str, q: str | None = None, short: bool = False): item = {"item_id": item_id} if q: item.update({"q": q}) if not short: item.update( {"description": "This is an amazing item that has a long description"} )
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 374 bytes - Click Count (0) -
docs_src/body_updates/tutorial002_py310.py
"baz": {"name": "Baz", "description": None, "price": 50.2, "tax": 10.5, "tags": []}, } @app.get("/items/{item_id}", response_model=Item) async def read_item(item_id: str): return items[item_id] @app.patch("/items/{item_id}", response_model=Item) async def update_item(item_id: str, item: Item): stored_item_data = items[item_id]
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 20 15:55:38 GMT 2025 - 1022 bytes - Click Count (0)