Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 229 for Weaver (0.27 sec)

  1. docs/zh/docs/tutorial/header-params.md

    # Header 参数
    
    定义 `Header` 参数的方式与定义 `Query`、`Path`、`Cookie` 参数相同。
    
    ## 导入 `Header`
    
    首先,导入 `Header`:
    
    === "Python 3.10+"
    
        ```Python hl_lines="3"
        {!> ../../../docs_src/header_params/tutorial001_an_py310.py!}
        ```
    
    === "Python 3.9+"
    
        ```Python hl_lines="3"
        {!> ../../../docs_src/header_params/tutorial001_an_py39.py!}
        ```
    
    === "Python 3.8+"
    
        ```Python hl_lines="3"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 22:42:51 GMT 2024
    - 5.4K bytes
    - Viewed (0)
  2. docs/ru/docs/tutorial/header-params.md

    # Header-параметры
    
    Вы можете определить параметры заголовка таким же образом, как вы определяете параметры `Query`, `Path` и `Cookie`.
    
    ## Импорт `Header`
    
    Сперва импортируйте `Header`:
    
    === "Python 3.10+"
    
        ```Python hl_lines="3"
        {!> ../../../docs_src/header_params/tutorial001_an_py310.py!}
        ```
    
    === "Python 3.9+"
    
        ```Python hl_lines="3"
        {!> ../../../docs_src/header_params/tutorial001_an_py39.py!}
        ```
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 8.7K bytes
    - Viewed (0)
  3. docs/ko/docs/tutorial/header-params.md

    ## `Header` 임포트
    
    먼저 `Header`를 임포트합니다:
    
    ```Python hl_lines="3"
    {!../../../docs_src/header_params/tutorial001.py!}
    ```
    
    ## `Header` 매개변수 선언
    
    `Path`, `Query` 그리고 `Cookie`를 사용한 동일한 구조를 이용하여 헤더 매개변수를 선언합니다.
    
    첫 번째 값은 기본값이며, 추가 검증이나 어노테이션 매개변수 모두 전달할 수 있습니다:
    
    ```Python hl_lines="9"
    {!../../../docs_src/header_params/tutorial001.py!}
    ```
    
    !!! note "기술 세부사항"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu May 12 00:06:16 GMT 2022
    - 3.3K bytes
    - Viewed (0)
  4. tests/test_security_http_bearer.py

    
    client = TestClient(app)
    
    
    def test_security_http_bearer():
        response = client.get("/users/me", headers={"Authorization": "Bearer foobar"})
        assert response.status_code == 200, response.text
        assert response.json() == {"scheme": "Bearer", "credentials": "foobar"}
    
    
    def test_security_http_bearer_no_credentials():
        response = client.get("/users/me")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2K bytes
    - Viewed (0)
  5. tests/test_security_openid_connect.py

        assert response.json() == {"username": "Bearer footokenbar"}
    
    
    def test_security_oauth2_password_other_header():
        response = client.get("/users/me", headers={"Authorization": "Other footokenbar"})
        assert response.status_code == 200, response.text
        assert response.json() == {"username": "Other footokenbar"}
    
    
    def test_security_oauth2_password_bearer_no_header():
        response = client.get("/users/me")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.2K bytes
    - Viewed (0)
  6. tests/test_security_openid_connect_description.py

        assert response.json() == {"username": "Bearer footokenbar"}
    
    
    def test_security_oauth2_password_other_header():
        response = client.get("/users/me", headers={"Authorization": "Other footokenbar"})
        assert response.status_code == 200, response.text
        assert response.json() == {"username": "Other footokenbar"}
    
    
    def test_security_oauth2_password_bearer_no_header():
        response = client.get("/users/me")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.4K bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/security/first-steps.md

        * But it needs authentication for that specific endpoint.
        * So, to authenticate with our API, it sends a header `Authorization` with a value of `Bearer ` plus the token.
        * If the token contains `foobar`, the content of the `Authorization` header would be: `Bearer foobar`.
    
    ## **FastAPI**'s `OAuth2PasswordBearer`
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 8.9K bytes
    - Viewed (0)
  8. tests/test_params_repr.py

    
    def test_header_repr_str():
        assert repr(Header("teststr")) == "Header(teststr)"
    
    
    def test_header_repr_none():
        assert repr(Header(None)) == "Header(None)"
    
    
    def test_header_repr_ellipsis():
        assert repr(Header(...)) == IsOneOf(
            "Header(PydanticUndefined)",
            # TODO: remove when deprecating Pydantic v1
            "Header(Ellipsis)",
        )
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 3.3K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_header_params/test_tutorial002_an_py310.py

    @pytest.fixture(name="client")
    def get_client():
        from docs_src.header_params.tutorial002_an_py310 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    @pytest.mark.parametrize(
        "path,headers,expected_status,expected_response",
        [
            ("/items", None, 200, {"strange_header": None}),
            ("/items", {"X-Header": "notvalid"}, 200, {"strange_header": None}),
            (
                "/items",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.2K bytes
    - Viewed (0)
  10. docs_src/header_params/tutorial002_an_py310.py

    from typing import Annotated
    
    from fastapi import FastAPI, Header
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        strange_header: Annotated[str | None, Header(convert_underscores=False)] = None,
    ):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 261 bytes
    - Viewed (0)
Back to top