mirror of
https://github.com/fastapi/fastapi.git
synced 2025-12-26 07:40:57 -05:00
Co-authored-by: Yurii Motov <yurii.motov.monte@gmail.com> Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
13 lines
260 B
Python
13 lines
260 B
Python
from typing import Union
|
|
|
|
from fastapi import FastAPI, Header
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.get("/items/")
|
|
async def read_items(
|
|
strange_header: Union[str, None] = Header(default=None, convert_underscores=False),
|
|
):
|
|
return {"strange_header": strange_header}
|