mirror of
https://github.com/fastapi/fastapi.git
synced 2025-12-24 06:39:31 -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
222 B
Python
10 lines
222 B
Python
from fastapi import FastAPI, Response
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.get("/headers-and-object/")
|
|
def get_headers(response: Response):
|
|
response.headers["X-Cat-Dog"] = "alone in the world"
|
|
return {"message": "Hello World"}
|