Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for Leider (0.18 sec)

  1. tests/test_schema_extra_examples.py

            @app.get("/header_example/")
            def header_example(
                data: Union[str, None] = Header(
                    default=None,
                    example="header1",
                ),
            ):
                return data
    
        @app.get("/header_examples/")
        def header_examples(
            data: Union[str, None] = Header(
                default=None,
                examples=[
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 37.7K bytes
    - Viewed (0)
  2. tests/test_security_oauth2_optional.py

            }
        },
        auto_error=False,
    )
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: Optional[str] = Security(reusable_oauth2)):
        if oauth_header is None:
            return None
        user = User(username=oauth_header)
        return user
    
    
    @app.post("/login")
    def login(form_data: OAuth2PasswordRequestFormStrict = Depends()):
        return form_data
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 10.8K bytes
    - Viewed (0)
  3. tests/test_openapi_examples.py

    ):
        return data
    
    
    @app.get("/header_examples/")
    def header_examples(
        data: Union[str, None] = Header(
            default=None,
            examples=[
                "json_schema_header1",
                "json_schema_header2",
            ],
            openapi_examples={
                "Header One": {
                    "summary": "Header One Summary",
                    "description": "Header One Description",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 17K bytes
    - Viewed (0)
  4. fastapi/dependencies/utils.py

            dependant.query_params, request.query_params
        )
        header_values, header_errors = request_params_to_args(
            dependant.header_params, request.headers
        )
        cookie_values, cookie_errors = request_params_to_args(
            dependant.cookie_params, request.cookies
        )
        values.update(path_values)
        values.update(query_values)
        values.update(header_values)
        values.update(cookie_values)
    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)
  5. scripts/docs.py

        frontmatter_end = match_pre.end()
        pre_end = match_start.end()
        post_start = match_end.start()
        template = Template(index_sponsors_template)
        message = template.render(sponsors=sponsors)
        pre_content = content[frontmatter_end:pre_end]
        post_content = content[post_start:]
        new_content = pre_content + message + post_content
        return new_content
    
    
    @app.command()
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Jan 22 19:26:14 GMT 2024
    - 10.9K bytes
    - Viewed (1)
  6. tests/test_tutorial/test_bigger_applications/test_main_an.py

        assert response.json() == {"detail": "X-Token header invalid"}
    
    
    def test_items_bar_with_invalid_token(client: TestClient):
        response = client.get("/items/bar?token=jessica", headers={"X-Token": "invalid"})
        assert response.status_code == 400
        assert response.json() == {"detail": "X-Token header invalid"}
    
    
    def test_items_with_missing_x_token_header(client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 24.6K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_bigger_applications/test_main_an_py39.py

        assert response.json() == {"detail": "X-Token header invalid"}
    
    
    @needs_py39
    def test_items_bar_with_invalid_token(client: TestClient):
        response = client.get("/items/bar?token=jessica", headers={"X-Token": "invalid"})
        assert response.status_code == 400
        assert response.json() == {"detail": "X-Token header invalid"}
    
    
    @needs_py39
    def test_items_with_missing_x_token_header(client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 24.9K bytes
    - Viewed (0)
  8. fastapi/security/http.py

        `HTTPDigest` in a dependency.
    
        The HTTP authorization header value is split by the first space.
    
        The first part is the `scheme`, the second part is the `credentials`.
    
        For example, in an HTTP Bearer token scheme, the client will send a header
        like:
    
        ```
        Authorization: Bearer deadbeef12346
        ```
    
        In this case:
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Apr 19 15:29:38 GMT 2024
    - 13.2K bytes
    - Viewed (0)
  9. fastapi/security/oauth2.py

                Doc(
                    """
                    By default, if no HTTP Authorization header is provided, required for
                    OAuth2 authentication, it will automatically cancel the request and
                    send the client an error.
    
                    If `auto_error` is set to `False`, when the HTTP Authorization header
                    is not available, instead of erroring out, the dependency result will
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 21.1K bytes
    - Viewed (1)
  10. fastapi/params.py

    from typing_extensions import Annotated, deprecated
    
    from ._compat import PYDANTIC_V2, PYDANTIC_VERSION, Undefined
    
    _Unset: Any = Undefined
    
    
    class ParamTypes(Enum):
        query = "query"
        header = "header"
        path = "path"
        cookie = "cookie"
    
    
    class Param(FieldInfo):
        in_: ParamTypes
    
        def __init__(
            self,
            default: Any = Undefined,
            *,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 27.5K bytes
    - Viewed (1)
Back to top