mirror of
https://github.com/fastapi/fastapi.git
synced 2025-12-23 22:29:34 -05:00
Co-authored-by: Yurii Motov <yurii.motov.monte@gmail.com> Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
11 lines
202 B
Python
11 lines
202 B
Python
from typing import Union
|
|
|
|
from fastapi import Cookie, FastAPI
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.get("/items/")
|
|
async def read_items(ads_id: Union[str, None] = Cookie(default=None)):
|
|
return {"ads_id": ads_id}
|