- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 540 for item_d (0.03 sec)
-
tests/test_starlette_exception.py
app = FastAPI() items = {"foo": "The Foo Wrestlers"} @app.get("/items/{item_id}") async def read_item(item_id: str): if item_id not in items: raise HTTPException( status_code=404, detail="Item not found", headers={"X-Error": "Some custom header"}, ) return {"item": items[item_id]} @app.get("/http-no-body-statuscode-exception")
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 7.4K bytes - Viewed (0) -
docs_src/body_updates/tutorial001_py310.py
} @app.get("/items/{item_id}", response_model=Item) async def read_item(item_id: str): return items[item_id] @app.put("/items/{item_id}", response_model=Item) async def update_item(item_id: str, item: Item): update_item_encoded = jsonable_encoder(item) items[item_id] = update_item_encoded
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Jan 07 14:11:31 UTC 2022 - 856 bytes - Viewed (0) -
tests/test_extra_routes.py
def delete_item(item_id: str, item: Item): return {"item_id": item_id, "item": item} @app.head("/items/{item_id}") def head_item(item_id: str): return JSONResponse(None, headers={"x-fastapi-item-id": item_id}) @app.options("/items/{item_id}") def options_item(item_id: str): return JSONResponse(None, headers={"x-fastapi-item-id": item_id}) @app.patch("/items/{item_id}") def patch_item(item_id: str, item: Item):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 13.5K bytes - Viewed (0) -
docs_src/path_params_numeric_validations/tutorial003_py39.py
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 268 bytes - Viewed (0) -
docs_src/path_params_numeric_validations/tutorial004_an_py39.py
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 317 bytes - Viewed (0) -
docs_src/path_params_numeric_validations/tutorial005_an_py39.py
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 331 bytes - Viewed (0) -
docs_src/path_params_numeric_validations/tutorial001_py39.py
from typing import Union from fastapi import FastAPI, Path, Query app = FastAPI() @app.get("/items/{item_id}") async def read_items( item_id: int = Path(title="The ID of the item to get"), q: Union[str, None] = Query(default=None, alias="item-query"), ): results = {"item_id": item_id} if q: results.update({"q": q})
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 364 bytes - Viewed (0) -
docs_src/body/tutorial004_py310.py
from fastapi import FastAPI from pydantic import BaseModel class Item(BaseModel): name: str description: str | None = None price: float tax: float | None = None app = FastAPI() @app.put("/items/{item_id}") async def update_item(item_id: int, item: Item, q: str | None = None): result = {"item_id": item_id, **item.model_dump()} if q: result.update({"q": q})Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 20 15:55:38 UTC 2025 - 414 bytes - Viewed (0) -
docs_src/body_multiple_params/tutorial005_an_py310.py
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: Annotated[Item, Body(embed=True)]): results = {"item_id": item_id, "item": item}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 409 bytes - Viewed (0) -
docs_src/schema_extra_example/tutorial003_py310.py
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( examples=[ { "name": "Foo", "description": "A very nice Item", "price": 35.4,
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 574 bytes - Viewed (0)