Send an HTML response to the client.
(send: Send, html_content: bytes, status: int = 200)
| 81 | |
| 82 | |
| 83 | async def send_html_response(send: Send, html_content: bytes, status: int = 200) -> None: |
| 84 | """Send an HTML response to the client.""" |
| 85 | await send( |
| 86 | { |
| 87 | 'type': 'http.response.start', |
| 88 | 'status': status, |
| 89 | 'headers': [[b'content-type', b'text/html; charset=utf-8']], |
| 90 | } |
| 91 | ) |
| 92 | await send({'type': 'http.response.body', 'body': html_content}) |
| 93 | |
| 94 | |
| 95 | async def app(scope: dict[str, Any], receive: Receive, send: Send) -> None: |
no outgoing calls
no test coverage detected