Coverage for docs_src / response_headers / tutorial001_py310.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.13.3, created at 2026-02-12 18:15 +0000

1from fastapi import FastAPI 1abcd

2from fastapi.responses import JSONResponse 1abcd

3 

4app = FastAPI() 1abcd

5 

6 

7@app.get("/headers/") 1abcd

8def get_headers(): 1abcd

9 content = {"message": "Hello World"} 1efg

10 headers = {"X-Cat-Dog": "alone in the world", "Content-Language": "en-US"} 1efg

11 return JSONResponse(content=content, headers=headers) 1efg