fastapi/post-route

POST Route

Create POST endpoint

routing
http

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