Files
fastapi/docs_src/custom_response/tutorial010_py310.py

10 lines
228 B
Python

from fastapi import FastAPI
from fastapi.responses import HTMLResponse
app = FastAPI(default_response_class=HTMLResponse)
@app.get("/items/")
async def read_items():
return "<h1>Items</h1><p>This is a list of items.</p>"