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

Method __init__

starlette/responses.py:33–46  ·  view source on GitHub ↗
(
        self,
        content: Any = None,
        status_code: int = 200,
        headers: Mapping[str, str] | None = None,
        media_type: str | None = None,
        background: BackgroundTask | None = None,
    )

Source from the content-addressed store, hash-verified

31 charset = "utf-8"
32
33 def __init__(
34 self,
35 content: Any = None,
36 status_code: int = 200,
37 headers: Mapping[str, str] | None = None,
38 media_type: str | None = None,
39 background: BackgroundTask | None = None,
40 ) -> None:
41 self.status_code = status_code
42 if media_type is not None:
43 self.media_type = media_type
44 self.background = background
45 self.body = self.render(content)
46 self.init_headers(headers)
47
48 def render(self, content: Any) -> bytes | memoryview:
49 if content is None:

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls 2

renderMethod · 0.95
init_headersMethod · 0.95

Tested by

no test coverage detected