Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 84 for _values (0.15 sec)

  1. tests/test_tutorial/test_query_params_str_validations/test_tutorial011_an_py39.py

        client = TestClient(app)
        return client
    
    
    @needs_py39
    def test_multi_query_values(client: TestClient):
        url = "/items/?q=foo&q=bar"
        response = client.get(url)
        assert response.status_code == 200, response.text
        assert response.json() == {"q": ["foo", "bar"]}
    
    
    @needs_py39
    def test_query_no_values(client: TestClient):
        url = "/items/"
        response = client.get(url)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.1K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_query_params_str_validations/test_tutorial012.py

    from docs_src.query_params_str_validations.tutorial012 import app
    
    client = TestClient(app)
    
    
    def test_default_query_values():
        url = "/items/"
        response = client.get(url)
        assert response.status_code == 200, response.text
        assert response.json() == {"q": ["foo", "bar"]}
    
    
    def test_multi_query_values():
        url = "/items/?q=baz&q=foobar"
        response = client.get(url)
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.4K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_query_params_str_validations/test_tutorial012_an.py

    from docs_src.query_params_str_validations.tutorial012_an import app
    
    client = TestClient(app)
    
    
    def test_default_query_values():
        url = "/items/"
        response = client.get(url)
        assert response.status_code == 200, response.text
        assert response.json() == {"q": ["foo", "bar"]}
    
    
    def test_multi_query_values():
        url = "/items/?q=baz&q=foobar"
        response = client.get(url)
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.4K bytes
    - Viewed (0)
  4. tests/test_jsonable_encoder.py

        admin = "admin"
        normal = "normal"
    
    
    class ModelWithConfig(BaseModel):
        role: Optional[RoleEnum] = None
    
        if PYDANTIC_V2:
            model_config = {"use_enum_values": True}
        else:
    
            class Config:
                use_enum_values = True
    
    
    class ModelWithAlias(BaseModel):
        foo: str = Field(alias="Foo")
    
    
    class ModelWithDefault(BaseModel):
        foo: str = ...  # type: ignore
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 9K bytes
    - Viewed (0)
  5. tests/test_tuples.py

        response = client.post("/tuple-form/", data={"values": ("1", "2")})
        assert response.status_code == 200, response.text
        assert response.json() == [1, 2]
    
    
    def test_tuple_form_invalid():
        response = client.post("/tuple-form/", data={"values": ("1", "2", "3")})
        assert response.status_code == 422, response.text
    
        response = client.post("/tuple-form/", data={"values": ("1")})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 11.8K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_header_params/test_tutorial003_an.py

    @pytest.mark.parametrize(
        "path,headers,expected_status,expected_response",
        [
            ("/items", None, 200, {"X-Token values": None}),
            ("/items", {"x-token": "foo"}, 200, {"X-Token values": ["foo"]}),
            # TODO: fix this, is it a bug?
            # ("/items", [("x-token", "foo"), ("x-token", "bar")], 200, {"X-Token values": ["foo", "bar"]}),
        ],
    )
    def test(path, headers, expected_status, expected_response):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.1K bytes
    - Viewed (0)
  7. docs/en/docs/how-to/nosql-databases-couchbase.md

    ### `dict` unpacking
    
    If you are not familiar with the `UserInDB(**result.value)`, <a href="https://docs.python.org/3/glossary.html#term-argument" class="external-link" target="_blank">it is using `dict` "unpacking"</a>.
    
    It will take the `dict` at `result.value`, and take each of its keys and values and pass them as key-values to `UserInDB` as keyword arguments.
    
    So, if the `dict` contains:
    
    ```Python
    {
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Jan 16 13:23:25 GMT 2024
    - 6K bytes
    - Viewed (0)
  8. docs/en/docs/python-types.md

    ```Python hl_lines="1"
    {!../../../docs_src/python_types/tutorial005.py!}
    ```
    
    ### Generic types with type parameters
    
    There are some data structures that can contain other values, like `dict`, `list`, `set` and `tuple`. And the internal values can have their own type too.
    
    These types that have internal types are called "**generic**" types. And it's possible to declare them, even with their internal types.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17K bytes
    - Viewed (0)
  9. docs/en/docs/tutorial/body-multiple-params.md

    ## Singular values in body
    
    The same way there is a `Query` and `Path` to define extra data for query and path parameters, **FastAPI** provides an equivalent `Body`.
    
    For example, extending the previous model, you could decide that you want to have another key `importance` in the same body, besides the `item` and `user`.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 7.7K bytes
    - Viewed (0)
  10. docs/ko/docs/tutorial/header-params.md

    {!../../../docs_src/header_params/tutorial003.py!}
    ```
    
    다음과 같은 두 개의 HTTP 헤더를 전송하여 해당 *경로* 와 통신할 경우:
    
    ```
    X-Token: foo
    X-Token: bar
    ```
    
    응답은 다음과 같습니다:
    
    ```JSON
    {
        "X-Token values": [
            "bar",
            "foo"
        ]
    }
    ```
    
    ## 요약
    
    `Header`는 `Query`, `Path`, `Cookie`와 동일한 패턴을 사용하여 선언합니다.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 12 00:06:16 GMT 2022
    - 3.3K bytes
    - Viewed (0)
Back to top