Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 26 for and (0.14 sec)

  1. fastapi/security/api_key.py

        with the API key and integrates that into the OpenAPI documentation. It extracts
        the key value sent in the query parameter automatically and provides it as the
        dependency result. But it doesn't define how to send that API key to the client.
    
        ## Usage
    
        Create an instance object and use that object as the dependency in `Depends()`.
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 23 22:29:18 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  2. fastapi/dependencies/utils.py

                if (
                    isinstance(field_info, params.File)
                    and is_bytes_field(field)
                    and isinstance(value, UploadFile)
                ):
                    value = await value.read()
                elif (
                    is_bytes_sequence_field(field)
                    and isinstance(field_info, params.File)
                    and value_is_sequence(value)
                ):
                    # For types
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:52:56 GMT 2024
    - 29.5K bytes
    - Viewed (0)
  3. fastapi/openapi/utils.py

        *, route: routing.APIRoute, method: str
    ) -> str:  # pragma: nocover
        warnings.warn(
            "fastapi.openapi.utils.generate_operation_id() was deprecated, "
            "it is not used internally, and will be removed soon",
            DeprecationWarning,
            stacklevel=2,
        )
        if route.operation_id:
            return route.operation_id
        path: str = route.path_format
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 21.8K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an_py39.py

    from dirty_equals import IsDict
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py39
    
    
    @pytest.fixture(name="app")
    def get_app():
        from docs_src.request_forms_and_files.tutorial001_an_py39 import app
    
        return app
    
    
    @pytest.fixture(name="client")
    def get_client(app: FastAPI):
        client = TestClient(app)
        return client
    
    
    @needs_py39
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py

    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from docs_src.custom_request_and_route.tutorial002 import app
    
    client = TestClient(app)
    
    
    def test_endpoint_works():
        response = client.post("/", json=[1, 2, 3])
        assert response.json() == 6
    
    
    def test_exception_handler_body_access():
        response = client.post("/", json={"numbers": [1, 2, 3]})
        assert response.json() == IsDict(
            {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 1.2K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py

    import pytest
    from dirty_equals import IsDict
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(name="app")
    def get_app():
        from docs_src.request_forms_and_files.tutorial001 import app
    
        return app
    
    
    @pytest.fixture(name="client")
    def get_client(app: FastAPI):
        client = TestClient(app)
        return client
    
    
    def test_post_form_no_body(client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  7. fastapi/applications.py

                    from Starlette and supported for compatibility.
    
                    ---
    
                    A list of routes to serve incoming HTTP and WebSocket requests.
                    """
                ),
                deprecated(
                    """
                    You normally wouldn't use this parameter with FastAPI, it is inherited
                    from Starlette and supported for compatibility.
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 172.2K bytes
    - Viewed (0)
  8. fastapi/openapi/docs.py

                """
            ),
        ] = None,
    ) -> HTMLResponse:
        """
        Generate and return the HTML  that loads Swagger UI for the interactive
        API docs (normally served at `/docs`).
    
        You would only call this function yourself if you needed to override some parts,
        for example the URLs to use to load Swagger UI's JavaScript and CSS.
    
        Read more about it in the
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 10.1K bytes
    - Viewed (0)
  9. docs_src/security/tutorial007_an_py39.py

        correct_password_bytes = b"swordfish"
        is_correct_password = secrets.compare_digest(
            current_password_bytes, correct_password_bytes
        )
        if not (is_correct_username and is_correct_password):
            raise HTTPException(
                status_code=status.HTTP_401_UNAUTHORIZED,
                detail="Incorrect username or password",
                headers={"WWW-Authenticate": "Basic"},
            )
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 1.1K bytes
    - Viewed (0)
  10. fastapi/openapi/models.py

        else_: Optional["SchemaOrBool"] = Field(default=None, alias="else")
        dependentSchemas: Optional[Dict[str, "SchemaOrBool"]] = None
        prefixItems: Optional[List["SchemaOrBool"]] = None
        # TODO: uncomment and remove below when deprecating Pydantic v1
        # It generales a list of schemas for tuples, before prefixItems was available
        # items: Optional["SchemaOrBool"] = None
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 22:49:33 GMT 2024
    - 15K bytes
    - Viewed (1)
Back to top