- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for onrender (0.39 sec)
-
docs/de/docs/advanced/custom-response.md
Sie könnten eine `CustomORJSONResponse` erstellen. Das Wichtigste, was Sie tun müssen, ist, eine `Response.render(content)`-Methode zu erstellen, die den Inhalt als `bytes` zurückgibt: ```Python hl_lines="9-14 17" {!../../../docs_src/custom_response/tutorial009c.py!} ``` Statt: ```json
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Jan 23 13:05:12 GMT 2024 - 13.5K bytes - Viewed (0) -
docs/en/docs/advanced/custom-response.md
Let's say you want it to return indented and formatted JSON, so you want to use the orjson option `orjson.OPT_INDENT_2`. You could create a `CustomORJSONResponse`. The main thing you have to do is create a `Response.render(content)` method that returns the content as `bytes`: ```Python hl_lines="9-14 17" {!../../../docs_src/custom_response/tutorial009c.py!} ``` Now instead of returning: ```json
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 11.7K bytes - Viewed (0)