mirror of
https://github.com/fastapi/fastapi.git
synced 2026-11-25 19:16:14 +08:00
12 lines
213 B
Python
12 lines
213 B
Python
from typing import Optional
|
|
|
|
from fastapi import FastAPI, Query
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.get("/items/")
|
|
async def read_items(q: Optional[list[str]] = Query(None)):
|
|
query_items = {"q": q}
|
|
return query_items
|