Files
fastapi/docs_src/header_params/tutorial003_py310.py
Sebastián Ramírez d08a062ee2 Add docs and tests for Python 3.9 and Python 3.10 (#3712)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2022-01-07 15:11:31 +01:00

9 lines
178 B
Python

from fastapi import FastAPI, Header
app = FastAPI()
@app.get("/items/")
async def read_items(x_token: list[str] | None = Header(None)):
return {"X-Token values": x_token}