Coverage for docs_src / custom_response / tutorial002_py310.py: 100%

6 statements  

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

1from fastapi import FastAPI 1abc

2from fastapi.responses import HTMLResponse 1abc

3 

4app = FastAPI() 1abc

5 

6 

7@app.get("/items/", response_class=HTMLResponse) 1abc

8async def read_items(): 1abc

9 return """ 1def

10 <html> 

11 <head> 

12 <title>Some HTML in here</title> 

13 </head> 

14 <body> 

15 <h1>Look ma! HTML!</h1> 

16 </body> 

17 </html> 

18 """