MCPcopy Create free account
hub / github.com/encode/starlette / JSONResponse

Class JSONResponse

starlette/responses.py:183–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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