mirror of
https://github.com/fastapi/fastapi.git
synced 2026-09-14 13:36:21 +08:00
d08a062ee2
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
11 lines
210 B
Python
11 lines
210 B
Python
from typing import Optional
|
|
|
|
from fastapi import FastAPI, Header
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.get("/items/")
|
|
async def read_items(x_token: Optional[list[str]] = Header(None)):
|
|
return {"X-Token values": x_token}
|