Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 65 for Kent (0.2 sec)

  1. docs_src/request_files/tutorial001_02.py

        if not file:
            return {"message": "No file sent"}
        else:
            return {"file_size": len(file)}
    
    
    @app.post("/uploadfile/")
    async def create_upload_file(file: Union[UploadFile, None] = None):
        if not file:
            return {"message": "No upload file sent"}
        else:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 508 bytes
    - Viewed (0)
  2. docs_src/background_tasks/tutorial002_an.py

        email: str, background_tasks: BackgroundTasks, q: Annotated[str, Depends(get_query)]
    ):
        message = f"message to {email}\n"
        background_tasks.add_task(write_log, message)
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 725 bytes
    - Viewed (0)
  3. tests/test_tutorial/test_request_files/test_tutorial001_02_an_py39.py

        assert response.status_code == 200, response.text
        assert response.json() == {"message": "No file sent"}
    
    
    @needs_py39
    def test_post_uploadfile_no_body(client: TestClient):
        response = client.post("/uploadfile/")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "No upload file sent"}
    
    
    @needs_py39
    def test_post_file(tmp_path: Path, client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 8.5K bytes
    - Viewed (0)
  4. docs/fr/docs/tutorial/background-tasks.md

        * Étant donné que se connecter à un serveur et envoyer un email a tendance à être «lent» (plusieurs secondes), vous pouvez retourner la réponse directement et envoyer la notification en arrière-plan.
    * Traiter des données :
        * Par exemple, si vous recevez un fichier qui doit passer par un traitement lent, vous pouvez retourner une réponse «Accepted» (HTTP 202) puis faire le traitement en arrière-plan.
    
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 12 00:06:16 GMT 2022
    - 5.7K bytes
    - Viewed (0)
  5. docs/en/docs/tutorial/request-files.md

        E.g. `pip install python-multipart`.
    
        This is because uploaded files are sent as "form data".
    
    ## Import `File`
    
    Import `File` and `UploadFile` from `fastapi`:
    
    === "Python 3.9+"
    
        ```Python hl_lines="3"
        {!> ../../../docs_src/request_files/tutorial001_an_py39.py!}
        ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 10.2K bytes
    - Viewed (0)
  6. docs/en/docs/advanced/openapi-callbacks.md

    ### The callback path expression
    
    The callback *path* can have an <a href="https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#key-expression" class="external-link" target="_blank">OpenAPI 3 expression</a> that can contain parts of the original request sent to *your API*.
    
    In this case, it's the `str`:
    
    ```Python
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  7. docs/ja/docs/tutorial/dependencies/dependencies-with-yield.md

    participant dep as Dep with yield
    participant operation as Path Operation
    participant tasks as Background tasks
    
        Note over client,tasks: Can raise exception for dependency, handled after response is sent
        Note over client,operation: Can raise HTTPException and can change the response
        client ->> dep: Start request
        Note over dep: Run code up to yield
        opt raise
            dep -->> handler: Raise HTTPException
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 12.5K bytes
    - Viewed (0)
  8. docs_src/background_tasks/tutorial001.py

    @app.post("/send-notification/{email}")
    async def send_notification(email: str, background_tasks: BackgroundTasks):
        background_tasks.add_task(write_notification, email, message="some notification")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 519 bytes
    - Viewed (0)
  9. tests/test_tutorial/test_background_tasks/test_tutorial002_py310.py

            os.remove(log)  # pragma: no cover
        response = client.post("/send-notification/******@****.***?q=some-query")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Message sent"}
        with open("./log.txt") as f:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 628 bytes
    - Viewed (0)
  10. tests/test_tutorial/test_background_tasks/test_tutorial002_an_py39.py

            os.remove(log)  # pragma: no cover
        response = client.post("/send-notification/******@****.***?q=some-query")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Message sent"}
        with open("./log.txt") as f:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 628 bytes
    - Viewed (0)
Back to top