Coverage for docs_src / custom_response / tutorial003_py310.py: 100%
7 statements
« prev ^ index » next coverage.py v7.13.3, created at 2026-04-06 01:24 +0000
« prev ^ index » next coverage.py v7.13.3, created at 2026-04-06 01:24 +0000
1from fastapi import FastAPI 1abcdef
2from fastapi.responses import HTMLResponse 1abcdef
4app = FastAPI() 1abcdef
7@app.get("/items/") 1abcdef
8async def read_items(): 1abcdef
9 html_content = """ 1ghij
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) 1ghij