9 changed files with 8 additions and 57 deletions
@ -1,11 +0,0 @@ |
|||||
from typing import Union |
|
||||
|
|
||||
from fastapi import FastAPI, Header |
|
||||
from typing_extensions import Annotated |
|
||||
|
|
||||
app = FastAPI() |
|
||||
|
|
||||
|
|
||||
@app.get("/items/") |
|
||||
async def read_items(user_agent: Annotated[Union[str, None], Header()] = None): |
|
||||
return {"User-Agent": user_agent} |
|
||||
@ -1,15 +0,0 @@ |
|||||
from typing import Union |
|
||||
|
|
||||
from fastapi import FastAPI, Header |
|
||||
from typing_extensions import Annotated |
|
||||
|
|
||||
app = FastAPI() |
|
||||
|
|
||||
|
|
||||
@app.get("/items/") |
|
||||
async def read_items( |
|
||||
strange_header: Annotated[ |
|
||||
Union[str, None], Header(convert_underscores=False) |
|
||||
] = None, |
|
||||
): |
|
||||
return {"strange_header": strange_header} |
|
||||
@ -1,10 +0,0 @@ |
|||||
from typing import List, Union |
|
||||
|
|
||||
from fastapi import FastAPI, Header |
|
||||
|
|
||||
app = FastAPI() |
|
||||
|
|
||||
|
|
||||
@app.get("/items/") |
|
||||
async def read_items(x_token: Union[List[str], None] = Header(default=None)): |
|
||||
return {"X-Token values": x_token} |
|
||||
@ -1,11 +0,0 @@ |
|||||
from typing import List, Union |
|
||||
|
|
||||
from fastapi import FastAPI, Header |
|
||||
from typing_extensions import Annotated |
|
||||
|
|
||||
app = FastAPI() |
|
||||
|
|
||||
|
|
||||
@app.get("/items/") |
|
||||
async def read_items(x_token: Annotated[Union[List[str], None], Header()] = None): |
|
||||
return {"X-Token values": x_token} |
|
||||
Loading…
Reference in new issue