Explanation
Defines a POST endpoint that accepts data in the request body
Examples
Create new item
@app.post("/items/")
def create_item(item: Item):
db.save(item)
return item
Defines a POST endpoint that accepts data in the request body
Create new item
@app.post("/items/")
def create_item(item: Item):
db.save(item)
return item