FastAPI - Calculator GET
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
async def main(a: int, b: int):
return {"message": a+b}
http://localhost:8000/?a=2&b=3
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
async def main(a: int, b: int):
return {"message": a+b}
http://localhost:8000/?a=2&b=3