mirror of
https://github.com/fastapi/fastapi.git
synced 2025-12-30 09:39:20 -05:00
Co-authored-by: Yurii Motov <yurii.motov.monte@gmail.com> Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
10 lines
272 B
Python
10 lines
272 B
Python
from fastapi import FastAPI, Response
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.post("/cookie-and-object/")
|
|
def create_cookie(response: Response):
|
|
response.set_cookie(key="fakesession", value="fake-cookie-session-value")
|
|
return {"message": "Come to the dark side, we have cookies"}
|