(html: str)
| 166 | |
| 167 | |
| 168 | def encode_html(html: str) -> tuple[dict[str, str], ByteStream]: |
| 169 | body = html.encode("utf-8") |
| 170 | content_length = str(len(body)) |
| 171 | content_type = "text/html; charset=utf-8" |
| 172 | headers = {"Content-Length": content_length, "Content-Type": content_type} |
| 173 | return headers, ByteStream(body) |
| 174 | |
| 175 | |
| 176 | def encode_json(json: Any) -> tuple[dict[str, str], ByteStream]: |
no test coverage detected