- Sort Score
- Num 10 results
- Language All
Results 31 - 40 of 543 for item_b (0.05 seconds)
-
tests/test_tutorial/test_body_fields/test_tutorial001.py
def test_items_5(client: TestClient): response = client.put("/items/5", json={"item": {"name": "Foo", "price": 3.0}}) assert response.status_code == 200 assert response.json() == { "item_id": 5, "item": {"name": "Foo", "price": 3.0, "description": None, "tax": None}, } def test_items_6(client: TestClient): response = client.put( "/items/6", json={ "item": {
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 18:19:10 GMT 2025 - 6.3K bytes - Click Count (0) -
tests/test_tutorial/test_body_multiple_params/test_tutorial004.py
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Dec 26 10:43:02 GMT 2025 - 9.3K bytes - Click Count (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[Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 12:54:56 GMT 2025 - 6.8K bytes - Click Count (0) -
tests/test_tutorial/test_body_updates/test_tutorial001.py
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 20 15:55:38 GMT 2025 - 6.6K bytes - Click Count (0) -
tests/test_application.py
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 18:19:10 GMT 2025 - 51.9K bytes - Click Count (0) -
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
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Tue Jan 09 14:44:08 GMT 2024 - 1.1K bytes - Click Count (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
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 1.1K bytes - Click Count (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
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Dec 26 10:43:02 GMT 2025 - 4.4K bytes - Click Count (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
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Thu Aug 15 22:31:16 GMT 2024 - 1.1K bytes - Click Count (0) -
docs_src/query_params_str_validations/tutorial008_an_py39.py
app = FastAPI() @app.get("/items/") async def read_items( q: Annotated[ Union[str, None], Query( title="Query string", description="Query string for the items to search in the database that have a good match", min_length=3, ), ] = None, ): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q:
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Tue Oct 24 20:26:06 GMT 2023 - 511 bytes - Click Count (0)