Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for Mendes (0.18 sec)

  1. docs/de/docs/advanced/custom-response.md

    2. Durch die Verwendung eines `with`-Blocks stellen wir sicher, dass das dateiΓ€hnliche Objekt geschlossen wird, nachdem die Generatorfunktion fertig ist. Also, nachdem sie mit dem Senden der Response fertig ist.
    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)
  2. 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)
  3. 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
    {"message": "Hello World"}
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 9.8K bytes
    - Viewed (0)
Back to top