Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 144 for nBytes (2.03 sec)

  1. docs_src/security/tutorial007_an.py

    ):
        current_username_bytes = credentials.username.encode("utf8")
        correct_username_bytes = b"stanleyjobson"
        is_correct_username = secrets.compare_digest(
            current_username_bytes, correct_username_bytes
        )
        current_password_bytes = credentials.password.encode("utf8")
        correct_password_bytes = b"swordfish"
        is_correct_password = secrets.compare_digest(
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 1.2K bytes
    - Viewed (0)
  2. tests/test_compat.py

        assert response2.json() == [1, 2]
    
    
    def test_is_bytes_sequence_annotation_union():
        # For coverage
        # TODO: in theory this would allow declaring types that could be lists of bytes
        # to be read from files and other types, but I'm not even sure it's a good idea
        # to support it as a first class "feature"
        assert is_bytes_sequence_annotation(Union[List[str], List[bytes]])
    
    
    def test_is_uploadfile_sequence_annotation():
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 2.8K bytes
    - Viewed (0)
  3. docs/em/docs/tutorial/request-files.md

    ๐Ÿ“ ๐Ÿ”œ ๐Ÿ“‚ "๐Ÿ“จ ๐Ÿ’ฝ".
    
    ๐Ÿšฅ ๐Ÿ‘† ๐Ÿ“ฃ ๐Ÿ†Ž ๐Ÿ‘† *โžก ๐Ÿ› ๏ธ ๐Ÿ”ข* ๐Ÿ”ข `bytes`, **FastAPI** ๐Ÿ”œ โœ ๐Ÿ“ ๐Ÿ‘† & ๐Ÿ‘† ๐Ÿ”œ ๐Ÿ“จ ๐ŸŽš `bytes`.
    
    โœ”๏ธ ๐Ÿคฏ ๐Ÿ‘ˆ ๐Ÿ‘‰ โ›“ ๐Ÿ‘ˆ ๐ŸŽ‚ ๐ŸŽš ๐Ÿ”œ ๐Ÿช ๐Ÿ’พ. ๐Ÿ‘‰ ๐Ÿ”œ ๐Ÿ‘ท ๐Ÿ‘ ๐Ÿคช ๐Ÿ“.
    
    โœ‹๏ธ ๐Ÿ“ค ๐Ÿ“š ๐Ÿ’ผ โ” ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ’ฐ โšช๏ธโžก๏ธ โš™๏ธ `UploadFile`.
    
    ## ๐Ÿ“ ๐Ÿ”ข โฎ๏ธ `UploadFile`
    
    ๐Ÿ”ฌ ๐Ÿ“ ๐Ÿ”ข โฎ๏ธ ๐Ÿ†Ž `UploadFile`:
    
    ```Python hl_lines="12"
    {!../../../docs_src/request_files/tutorial001.py!}
    ```
    
    โš™๏ธ `UploadFile` โœ”๏ธ ๐Ÿ“š ๐Ÿ“ˆ ๐Ÿคญ `bytes`:
    
    * ๐Ÿ‘† ๐Ÿšซ โœ”๏ธ โš™๏ธ `File()` ๐Ÿ”ข ๐Ÿ’ฒ ๐Ÿ”ข.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 6.6K bytes
    - Viewed (0)
  4. docs/ko/docs/tutorial/request-files.md

    !!! tip "ํŒ"
        File์˜ ๋ณธ๋ฌธ์„ ์„ ์–ธํ•  ๋•Œ, ๋งค๊ฐœ๋ณ€์ˆ˜๊ฐ€ ์ฟผ๋ฆฌ ๋งค๊ฐœ๋ณ€์ˆ˜ ๋˜๋Š” ๋ณธ๋ฌธ(JSON) ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ํ•ด์„๋˜๋Š”  ๊ฒƒ์„ ๋ฐฉ์ง€ํ•˜๊ธฐ ์œ„ํ•ด `File` ์„ ์‚ฌ์šฉํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค.
    
    ํŒŒ์ผ๋“ค์€ "ํผ ๋ฐ์ดํ„ฐ"์˜ ํ˜•ํƒœ๋กœ ์—…๋กœ๋“œ ๋ฉ๋‹ˆ๋‹ค.
    
    *๊ฒฝ๋กœ ์ž‘๋™ ํ•จ์ˆ˜*์˜ ๋งค๊ฐœ๋ณ€์ˆ˜๋ฅผ `bytes` ๋กœ ์„ ์–ธํ•˜๋Š” ๊ฒฝ์šฐ **FastAPI**๋Š” ํŒŒ์ผ์„ ์ฝ๊ณ  `bytes` ํ˜•ํƒœ์˜ ๋‚ด์šฉ์„ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค.
    
    ์ด๊ฒƒ์€ ์ „์ฒด ๋‚ด์šฉ์ด ๋ฉ”๋ชจ๋ฆฌ์— ์ €์žฅ๋œ๋‹ค๋Š” ๊ฒƒ์„ ์˜๋ฏธํ•œ๋‹ค๋Š” ๊ฑธ ์—ผ๋‘ํ•˜๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค. ์ด๋Š” ์ž‘์€ ํฌ๊ธฐ์˜ ํŒŒ์ผ๋“ค์— ์ ํ•ฉํ•ฉ๋‹ˆ๋‹ค.
    
    ์–ด๋–ค ๊ฒฝ์šฐ์—๋Š” `UploadFile` ์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด ๋” ์œ ๋ฆฌํ•ฉ๋‹ˆ๋‹ค.
    
    ## `File` ๋งค๊ฐœ๋ณ€์ˆ˜์™€  `UploadFile`
    
    `File` ๋งค๊ฐœ๋ณ€์ˆ˜๋ฅผ `UploadFile` ํƒ€์ž…์œผ๋กœ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค:
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 8.1K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_request_files/test_tutorial001_03.py

        path = tmp_path / "test.txt"
        path.write_bytes(b"<file content>")
    
        client = TestClient(app)
        with path.open("rb") as file:
            response = client.post("/files/", files={"file": file})
        assert response.status_code == 200, response.text
        assert response.json() == {"file_size": 14}
    
    
    def test_post_upload_file(tmp_path):
        path = tmp_path / "test.txt"
        path.write_bytes(b"<file content>")
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 6K bytes
    - Viewed (0)
  6. docs/en/docs/deployment/versions.md

    ## Available versions
    
    You can see the available versions (e.g. to check what is the current latest) in the [Release Notes](../release-notes.md){.internal-link target=_blank}.
    
    ## About versions
    
    Following the Semantic Versioning conventions, any version below `1.0.0` could potentially add breaking changes.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Nov 05 20:50:37 GMT 2020
    - 3.3K bytes
    - Viewed (0)
  7. docs/fr/docs/deployment/versions.md

    ## Versions disponibles
    
    Vous pouvez consulter les versions disponibles (par exemple, pour vรฉrifier quelle est la derniรจre version en date) dans les [Notes de version](../release-notes.md){.internal-link target=_blank}.
    
    ## ร€ propos des versions
    
    Suivant les conventions de versionnage sรฉmantique, toute version infรฉrieure ร  `1.0.0` peut potentiellement ajouter
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Oct 31 17:39:54 GMT 2022
    - 4K bytes
    - Viewed (0)
  8. docs_src/request_forms_and_files/tutorial001_an_py39.py

    from typing import Annotated
    
    from fastapi import FastAPI, File, Form, UploadFile
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_file(
        file: Annotated[bytes, File()],
        fileb: Annotated[UploadFile, File()],
        token: Annotated[str, Form()],
    ):
        return {
            "file_size": len(file),
            "token": token,
            "fileb_content_type": fileb.content_type,
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 386 bytes
    - Viewed (0)
  9. docs_src/request_files/tutorial001_02_py310.py

    from fastapi import FastAPI, File, UploadFile
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_file(file: bytes | None = File(default=None)):
        if not file:
            return {"message": "No file sent"}
        else:
            return {"file_size": len(file)}
    
    
    @app.post("/uploadfile/")
    async def create_upload_file(file: 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: Fri May 13 23:38:22 GMT 2022
    - 470 bytes
    - Viewed (0)
  10. docs/em/docs/advanced/path-operation-advanced-configuration.md

    ```Python hl_lines="20-37  39-40"
    {!../../../docs_src/path_operation_advanced_configuration/tutorial006.py!}
    ```
    
    ๐Ÿ‘‰ ๐Ÿ–ผ, ๐Ÿ‘ฅ ๐Ÿšซ ๐Ÿ“ฃ ๐Ÿ™† Pydantic ๐Ÿท. ๐Ÿ‘, ๐Ÿ“จ ๐Ÿ’ช ๐Ÿšซ <abbr title="converted from some plain format, like bytes, into Python objects">๐ŸŽป</abbr> ๐ŸŽป, โšซ๏ธ โœ ๐Ÿ”— `bytes`, &amp; ๐Ÿ”ข `magic_data_reader()` ๐Ÿ”œ ๐Ÿˆš ๐ŸŽป โšซ๏ธ ๐ŸŒŒ.
    
    ๐Ÿ‘, ๐Ÿ‘ฅ ๐Ÿ’ช ๐Ÿ“ฃ ๐Ÿ“ˆ ๐Ÿ”— ๐Ÿ“จ ๐Ÿ’ช.
    
    ### ๐Ÿ›ƒ ๐Ÿ—„ ๐ŸŽš ๐Ÿ†Ž
    
    โš™๏ธ ๐Ÿ‘‰ ๐ŸŽ ๐ŸŽฑ, ๐Ÿ‘† ๐Ÿ’ช โš™๏ธ Pydantic ๐Ÿท ๐Ÿ”ฌ ๐ŸŽป ๐Ÿ”— ๐Ÿ‘ˆ โคด๏ธ ๐Ÿ”Œ ๐Ÿ›ƒ ๐Ÿ—„ ๐Ÿ”— ๐Ÿ“„ *โžก ๐Ÿ› ๏ธ*.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 5.7K bytes
    - Viewed (0)
Back to top