- Sort Score
- Result 10 results
- Languages All
Results 91 - 100 of 726 for item_e (0.04 sec)
-
docs_src/app_testing/app_b_py310/main.py
return fake_db[item_id] @app.post("/items/", response_model=Item) async def create_item(item: Item, x_token: str = Header()): if x_token != fake_secret_token: raise HTTPException(status_code=400, detail="Invalid X-Token header") if item.id in fake_db: raise HTTPException(status_code=409, detail="Item already exists") fake_db[item.id] = item
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Tue Jan 09 14:44:08 UTC 2024 - 1.1K bytes - Viewed (0) -
docs_src/app_testing/app_b_py39/main.py
return fake_db[item_id] @app.post("/items/", response_model=Item) async def create_item(item: Item, x_token: str = Header()): if x_token != fake_secret_token: raise HTTPException(status_code=400, detail="Invalid X-Token header") if item.id in fake_db: raise HTTPException(status_code=409, detail="Item already exists") fake_db[item.id] = item
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 1.1K bytes - Viewed (0) -
docs_src/app_testing/app_b_an_py39/main.py
return fake_db[item_id] @app.post("/items/", response_model=Item) async def create_item(item: Item, x_token: Annotated[str, Header()]): if x_token != fake_secret_token: raise HTTPException(status_code=400, detail="Invalid X-Token header") if item.id in fake_db: raise HTTPException(status_code=409, detail="Item already exists") fake_db[item.id] = item
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Thu Aug 15 22:31:16 UTC 2024 - 1.1K bytes - Viewed (0) -
fastapi/exceptions.py
```python from fastapi import FastAPI, HTTPException 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") return {"item": items[item_id]} ``` """ def __init__( self, status_code: Annotated[Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 12:54:56 UTC 2025 - 6.8K bytes - Viewed (0) -
tests/test_tutorial/test_query_params_str_validations/test_tutorial006.py
response = client.get("/items/", params={"q": "fixedquery"}) assert response.status_code == 200 assert response.json() == { "items": [{"item_id": "Foo"}, {"item_id": "Bar"}], "q": "fixedquery", } def test_query_params_str_validations_q_fixedquery_too_short(client: TestClient): response = client.get("/items/", params={"q": "fa"}) assert response.status_code == 422
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 4.4K bytes - Viewed (0) -
tests/test_tutorial/test_handling_errors/test_tutorial001.py
def test_get_item(): response = client.get("/items/foo") assert response.status_code == 200, response.text assert response.json() == {"item": "The Foo Wrestlers"} def test_get_item_not_found(): response = client.get("/items/bar") assert response.status_code == 404, response.text assert response.headers.get("x-error") is None assert response.json() == {"detail": "Item not found"} def test_openapi_schema():
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 3.2K bytes - Viewed (0) -
docs_src/additional_responses/tutorial003_py39.py
from pydantic import BaseModel class Item(BaseModel): id: str value: str class Message(BaseModel): message: str app = FastAPI() @app.get( "/items/{item_id}", response_model=Item, responses={ 404: {"model": Message, "description": "The item was not found"}, 200: { "description": "Item requested by ID", "content": {Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 837 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)