MCPcopy
hub / github.com/encode/starlette / render

Method render

starlette/responses.py:48–53  ·  view source on GitHub ↗
(self, content: Any)

Source from the content-addressed store, hash-verified

46 self.init_headers(headers)
47
48 def render(self, content: Any) -> bytes | memoryview:
49 if content is None:
50 return b""
51 if isinstance(content, bytes | memoryview):
52 return content
53 return content.encode(self.charset) # type: ignore
54
55 def init_headers(self, headers: Mapping[str, str] | None = None) -> None:
56 if headers is None:

Callers 4

__init__Method · 0.95
__init__Method · 0.45

Calls

no outgoing calls

Tested by 2