📝 Add docs for custom response

This commit is contained in:
Sebastián Ramírez
2018-12-15 15:20:22 +04:00
parent 0df2720490
commit f6667ecfb0
7 changed files with 185 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
from fastapi import FastAPI
from starlette.responses import HTMLResponse
app = FastAPI()
@app.get("/items/", content_type=HTMLResponse)
async def read_items():
return """
<html>
<head>
<title>Some HTML in here</title>
</head>
<body>
<h1>Look ma! HTML!</h1>
</body>
</html>
"""