mirror of
https://github.com/fastapi/fastapi.git
synced 2025-12-23 22:29:34 -05:00
11 lines
234 B
Python
11 lines
234 B
Python
from typing import Annotated, Union
|
|
|
|
from fastapi import FastAPI, Header
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.get("/items/")
|
|
async def read_items(x_token: Annotated[Union[list[str], None], Header()] = None):
|
|
return {"X-Token values": x_token}
|