Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 92 for bytes (0.14 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. 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)
  3. 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)
  4. 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)
  5. docs/ru/docs/tutorial/request-forms-and-files.md

        {!> ../../../docs_src/request_forms_and_files/tutorial001.py!}
        ```
    
    Файлы и поля формы будут загружены в виде данных формы, и вы получите файлы и поля формы.
    
    Вы можете объявить некоторые файлы как `bytes`, а некоторые - как `UploadFile`.
    
    !!! warning "Внимание"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 2.9K bytes
    - Viewed (0)
  6. docs/en/docs/reference/websockets.md

                - receive
                - send
                - accept
                - receive_text
                - receive_bytes
                - receive_json
                - iter_text
                - iter_bytes
                - iter_json
                - send_text
                - send_bytes
                - send_json
                - close
    
    When a client disconnects, a `WebSocketDisconnect` exception is raised, you can catch it.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 1.6K bytes
    - Viewed (0)
  7. docs/ru/docs/python-types.md

    ### Простые типы
    
    Вы можете объявить все стандартные типы Python, а не только `str`.
    
    Вы можете использовать, к примеру:
    
    * `int`
    * `float`
    * `bool`
    * `bytes`
    
    ```Python hl_lines="1"
    {!../../../docs_src/python_types/tutorial005.py!}
    ```
    
    ### Generic-типы с параметрами типов
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 14.6K bytes
    - Viewed (0)
  8. docs/ru/docs/tutorial/request-files.md

    Файлы будут загружены как данные формы.
    
    Если вы объявите тип параметра у *функции операции пути* как `bytes`, то **FastAPI** прочитает файл за вас, и вы получите его содержимое в виде `bytes`.
    
    Следует иметь в виду, что все содержимое будет храниться в памяти. Это хорошо подходит для небольших файлов.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 15.4K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_request_files/test_tutorial002.py

                    }
                ]
            }
        )
    
    
    def test_post_files(tmp_path):
        path = tmp_path / "test.txt"
        path.write_bytes(b"<file content>")
        path2 = tmp_path / "test2.txt"
        path2.write_bytes(b"<file content2>")
    
        client = TestClient(app)
        with path.open("rb") as file, path2.open("rb") as file2:
            response = client.post(
                "/files/",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 8.5K bytes
    - Viewed (0)
  10. docs/zh/docs/tutorial/request-files.md

    文件作为「表单数据」上传。
    
    如果把*路径操作函数*参数的类型声明为 `bytes`,**FastAPI** 将以 `bytes` 形式读取和接收文件内容。
    
    这种方式把文件的所有内容都存储在内存里,适用于小型文件。
    
    不过,很多情况下,`UploadFile` 更好用。
    
    ## 含 `UploadFile` 的文件参数
    
    定义文件参数时使用 `UploadFile`:
    
    ```Python hl_lines="12"
    {!../../../docs_src/request_files/tutorial001.py!}
    ```
    
    `UploadFile` 与 `bytes` 相比有更多优势:
    
    * 使用 `spooled` 文件:
        * 存储在内存的文件超出最大上限时,FastAPI 会把文件存入磁盘;
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 6.9K bytes
    - Viewed (0)
Back to top