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

Class JSONResponse

starlette/responses.py:181–201  ·  starlette/responses.py::JSONResponse

Source from the content-addressed store, hash-verified

179
180
181class JSONResponse(Response):
182 media_type = class="st">"application/json"
183
184 def __init__(
185 self,
186 content: Any,
187 status_code: int = 200,
188 headers: Mapping[str, str] | None = None,
189 media_type: str | None = None,
190 background: BackgroundTask | None = None,
191 ) -> None:
192 super().__init__(content, status_code, headers, media_type, background)
193
194 def render(self, content: Any) -> bytes:
195 return json.dumps(
196 content,
197 ensure_ascii=False,
198 allow_nan=False,
199 indent=None,
200 separators=(class="st">",", class="st">":"),
201 ).encode(class="st">"utf-8")
202
203
204class RedirectResponse(Response):

Callers 15

appFunction · 0.90
appFunction · 0.90
error_500Function · 0.90
method_not_allowedFunction · 0.90
http_exceptionFunction · 0.90
state_countFunction · 0.90
homepageFunction · 0.90
dashboardFunction · 0.90
adminFunction · 0.90
dashboard_syncFunction · 0.90
getMethod · 0.90
admin_syncFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected