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

8 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2025-05-05 00:03 +0000

1from fastapi import FastAPI 1abcdef

2from fastapi.responses import JSONResponse 1abcdef

3 

4app = FastAPI() 1abcdef

5 

6 

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

8def get_headers(): 1abcdef

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

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

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