Debian Codegraph @

docs_src/custom_response/tutorial010_py310.py

raw
1 from fastapi import FastAPI
2 from fastapi.responses import HTMLResponse
3
4 app = FastAPI(default_response_class=HTMLResponse)
5
6
7 @app.get("/items/")
8 async def read_items():
9 return "<h1>Items</h1><p>This is a list of items.</p>"