async def view_html(request): """Return HTML content and a custom header.""" response = html("<b>HTML OK</b>") response.add_header(b'x-time', f"{time.time()}".encode()) return response
def req_ok(request): return html('ok')
async def home(): return html(EXAMPLE_HTML)
async def home(): return html(content, status)
def html(self, data, status: int = 200) -> Response: """ Returns a response with text/html content, and given status (default HTTP 200 OK). """ return html(data, status)