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

8 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-08-08 03:53 +0000

1from fastapi import FastAPI 1abcde

2from fastapi.responses import JSONResponse 1abcde

3 

4app = FastAPI() 1abcde

5 

6 

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

8def get_headers(): 1abcde

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

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

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