Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for related (0.19 sec)

  1. docs/en/docs/advanced/additional-status-codes.md

    But you also want it to accept new items. And when the items didn't exist before, it creates them, and returns an HTTP status code of 201 "Created".
    
    To achieve that, import `JSONResponse`, and return your content there directly, setting the `status_code` that you want:
    
    === "Python 3.10+"
    
        ```Python hl_lines="4  25"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 2.6K bytes
    - Viewed (0)
  2. docs/es/docs/advanced/additional-status-codes.md

    Pero también quieres que acepte nuevos ítems. Cuando los ítems no existan anteriormente, serán creados y devolverá un código de estado HTTP 201 "Created".
    
    Para conseguir esto importa `JSONResponse` y devuelve ahí directamente tu contenido, asignando el `status_code` que quieras:
    
    ```Python hl_lines="4  25"
    {!../../../docs_src/additional_status_codes/tutorial001.py!}
    ```
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Jan 13 11:57:27 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  3. docs/de/docs/advanced/additional-status-codes.md

    Sie möchten aber auch, dass sie neue Artikel akzeptiert. Und wenn die Elemente vorher nicht vorhanden waren, werden diese Elemente erstellt und der HTTP-Statuscode 201 „Created“ zurückgegeben.
    
    Um dies zu erreichen, importieren Sie `JSONResponse`, und geben Sie Ihren Inhalt direkt zurück, indem Sie den gewünschten `status_code` setzen:
    
    === "Python 3.10+"
    
        ```Python hl_lines="4  25"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Jan 23 13:04:57 GMT 2024
    - 3K bytes
    - Viewed (0)
Back to top