Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 58 for files (0.18 sec)

  1. docs_src/request_forms_and_files/tutorial001.py

    from fastapi import FastAPI, File, Form, UploadFile
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_file(
        file: bytes = File(), fileb: UploadFile = File(), token: str = Form()
    ):
        return {
            "file_size": len(file),
            "token": token,
            "fileb_content_type": fileb.content_type,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 317 bytes
    - Viewed (0)
  2. fastapi/datastructures.py

        ## Example
    
        ```python
        from typing import Annotated
    
        from fastapi import FastAPI, File, UploadFile
    
        app = FastAPI()
    
    
        @app.post("/files/")
        async def create_file(file: Annotated[bytes, File()]):
            return {"file_size": len(file)}
    
    
        @app.post("/uploadfile/")
        async def create_upload_file(file: UploadFile):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  3. tests/test_custom_middleware_exception.py

        with client:
            with open(path, "rb") as file:
                response = client.post("/middleware", files={"file": file})
            assert response.status_code == 422, response.text
            assert response.json() == {
                "detail": {
                    "name": "ContentSizeLimitExceeded",
                    "code": 999,
                    "message": "File limit exceeded",
                }
            }
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Aug 25 21:44:40 GMT 2022
    - 2.8K bytes
    - Viewed (0)
  4. docs_src/request_files/tutorial001_an.py

    from fastapi import FastAPI, File, UploadFile
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_file(file: Annotated[bytes, File()]):
        return {"file_size": len(file)}
    
    
    @app.post("/uploadfile/")
    async def create_upload_file(file: UploadFile):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 332 bytes
    - Viewed (0)
  5. bin/diff_yaml.py

    # See the License for the specific language governing permissions and
    # limitations under the License.
    #
    # Compare 2 multi document kubernetes yaml files
    # It ensures that order does not matter
    #
    from __future__ import print_function
    import argparse
    import datadiff
    import sys
    import yaml  # pyyaml
    
    # returns fully qualified resource name of the k8s resource
    
    
    def by_resource_name(res):
    Python
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Wed Mar 03 16:14:57 GMT 2021
    - 4.5K bytes
    - Viewed (0)
  6. docs_src/request_files/tutorial001_02_an.py

    from fastapi import FastAPI, File, UploadFile
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_file(file: Annotated[Union[bytes, None], File()] = None):
        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):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 553 bytes
    - Viewed (0)
  7. docs_src/request_files/tutorial001_02_an_py310.py

    from fastapi import FastAPI, File, UploadFile
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_file(file: Annotated[bytes | None, File()] = 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:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 505 bytes
    - Viewed (0)
  8. ci/official/wheel_test/test_import_api_packages.py

    from the current build or not.
    
    It uses the `_api/v2/api_packages.txt` file from the local wheel file.
    The `_api/v2/api_packages.txt` file is created during the process of generating
    TensorFlow API v2 init files and is stored in the wheel file after the build.
    
    See README.md file for "how to run" instruction.
    """
    
    import logging
    import unittest
    import pkg_resources
    
    Python
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Wed Sep 13 15:52:07 GMT 2023
    - 3.3K bytes
    - Viewed (0)
  9. configure.py

    ]
    
    # List of files to configure when building Bazel on Apple platforms.
    APPLE_BAZEL_FILES = [
        'tensorflow/lite/ios/BUILD', 'tensorflow/lite/objc/BUILD',
        'tensorflow/lite/swift/BUILD',
        'tensorflow/lite/tools/benchmark/experimental/ios/BUILD'
    ]
    
    # List of files to move when building for iOS.
    IOS_FILES = [
        'tensorflow/lite/objc/TensorFlowLiteObjC.podspec',
    Python
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Mon Apr 15 18:25:36 GMT 2024
    - 53.8K bytes
    - Viewed (0)
  10. fastapi/routing.py

        """
        `APIRouter` class, used to group *path operations*, for example to structure
        an app in multiple files. It would then be included in the `FastAPI` app, or
        in another `APIRouter` (ultimately included in the app).
    
        Read more about it in the
        [FastAPI docs for Bigger Applications - Multiple Files](https://fastapi.tiangolo.com/tutorial/bigger-applications/).
    
        ## Example
    
        ```python
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 170.1K bytes
    - Viewed (0)
Back to top