Debian Codegraph @

docs_src/response_headers/tutorial002_py310.py

raw
1 from fastapi import FastAPI, Response
2
3 app = FastAPI()
4
5
6 @app.get("/headers-and-object/")
7 def get_headers(response: Response):
8 response.headers["X-Cat-Dog"] = "alone in the world"
9 return {"message": "Hello World"}