Routing
路由的基本概念
@app.get("/")
def home():
return {"message": "這是首頁"}靜態路由(Static Routing)
@app.get("/about")
def about():
return {"info": "這是關於我們的頁面"}動態路由(Dynamic Routing)
FastAPI 範例:
多個動態參數:
路由參數的型別註記
查詢參數(Query Parameters)與路由配合
小結
類型
範例 URL
使用說明
Last updated