Coverage for docs_src / custom_response / tutorial003_py310.py: 100%
7 statements
« prev ^ index » next coverage.py v7.13.3, created at 2026-02-12 18:15 +0000
« 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
4app = FastAPI() 1abc
7@app.get("/items/") 1abc
8async def read_items(): 1abc
9 html_content = """ 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 """
19 return HTMLResponse(content=html_content, status_code=200) 1def