mirror of
https://github.com/fastapi/fastapi.git
synced 2026-11-09 01:23:17 -05:00
11 lines
217 B
Python
11 lines
217 B
Python
from typing import Annotated
|
|
|
|
from fastapi import FastAPI, Header
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.get("/items/")
|
|
async def read_items(user_agent: Annotated[str | None, Header()] = None):
|
|
return {"User-Agent": user_agent}
|