- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for CustomORJSONResponse (0.24 sec)
-
docs_src/custom_response/tutorial009c.py
from fastapi import FastAPI, Response app = FastAPI() class CustomORJSONResponse(Response): media_type = "application/json" def render(self, content: Any) -> bytes: assert orjson is not None, "orjson must be installed" return orjson.dumps(content, option=orjson.OPT_INDENT_2) @app.get("/", response_class=CustomORJSONResponse) async def main():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Sep 01 09:32:30 UTC 2022 - 451 bytes - Viewed (0) -
docs/em/docs/advanced/custom-response.md
âĄī¸ đŦ đ đ âĢī¸ đ¨ đ & đ đģ, đ đ âī¸ Orjson đ `orjson.OPT_INDENT_2`. đ đĒ â `CustomORJSONResponse`. đ đ đ âī¸ â `Response.render(content)` đŠâđŦ đ đ¨ đ `bytes`: ```Python hl_lines="9-14 17" {!../../docs_src/custom_response/tutorial009c.py!} ``` đ âŠī¸ đŦ: ```json
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 9.7K bytes - Viewed (0)