Creating HTTP Operation paths

GET request:

@app.get("/")
def root():
    return {"message": "Hello World"}

POST request:

@app.post("/createpost")
def create_posts():
    return {"message": "successfully created post"}

Last updated