MCPcopy
hub / github.com/encode/httpx / encode_html

Function encode_html

httpx/_content.py:168–173  ·  view source on GitHub ↗
(html: str)

Source from the content-addressed store, hash-verified

166
167
168def 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
176def encode_json(json: Any) -> tuple[dict[str, str], ByteStream]:

Callers 1

encode_responseFunction · 0.85

Calls 1

ByteStreamClass · 0.85

Tested by

no test coverage detected