Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

from fastapi import FastAPI

app = FastAPI()

@app.get("/")
def read_root():
    return {"Hello": "World"}
uvicorn main:app --reload
# Add
curl -X POST "http://127.0.0.1:8000/items/" -H "Content-Type: application/json" -d "{\"id\": 1, \"name\": \"Sample Item\", \"description\": \"This is a sample item\", \"price\": 10.99}"

# All Items
curl -X GET "http://127.0.0.1:8000/items/"
# Single Item
curl -X GET "http://127.0.0.1:8000/items/1"

# Update Item
curl -X PUT "http://127.0.0.1:8000/items/1" -H "Content-Type: application/json" -d "{\"id\": 1, \"name\": \"Updated Item\", \"description\": \"This item has been updated\", \"price\": 15.99}"

# Delete Item
curl -X DELETE "http://127.0.0.1:8000/items/1"

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages