We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f6bcf2d commit 33eecd6Copy full SHA for 33eecd6
fastapi-python-web-apis/main_start.py
@@ -8,19 +8,3 @@
8
@app.get("/")
9
def home():
10
return {"message": "Welcome to the Randomizer API"}
11
-
12
13
-@app.post("/items")
14
-def add_item(item: str):
15
- if not item.strip():
16
- raise HTTPException(status_code=400, detail="Item cannot be empty")
17
18
- if item in items_db:
19
- raise HTTPException(status_code=400, detail="Item already exists")
20
21
- items_db.append(item)
22
- return {
23
- "message": "Item added successfully",
24
- "item": item,
25
- "total_items": len(items_db),
26
- }
0 commit comments