Replies: 2 comments
-
from fastapi import FastAPI
app = FastAPI()
@app.get("/items")
def items(param1: str = Query(..., alias="query1"), param2: str = Query(..., alias="query2")):
return {"Hello": "World"} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
tiangolo
-
|
Thank you @Kludex |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to map query parameters to custom function parameters? For example, if the request is
/items?query1=q1&query2=q2, then can I define function parameters as shown below.
Beta Was this translation helpful? Give feedback.
All reactions