èæ¯ FastAPIã§ã¯ä»¥ä¸ã®ããã«ãã³ã¬ã¼ã¿é¢æ°ã使ããã¨ã§HTTPãµã¼ãã®pathãè¨å®ãããã¨ãã§ãããããPath Operationã¨å¼ã³ã¾ãã from fastapi import FastAPI app = FastAPI() @app.get("/") async def read_root(): return {"Hello": "World"} @app.get("/items/{item_id}") async def read_item(item_id: int, q: str = None): return {"item_id": item_id, "q": q} ãã®Path Operationã§defã使ãã¹ããasync defã使ãã¹ããã®æ¹éã説æãã¾ãã ç°å¢ Python 3.9.11 FastAPI 0.74.1 æ¹é çµè«ããè¨ãã¨ä»¥ä¸ã®æ¹éã§
{{#tags}}- {{label}}
{{/tags}}