Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 83 for VALUES (0.18 sec)

  1. tests/test_tutorial/test_header_params/test_tutorial003_py310.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, client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.3K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_header_params/test_tutorial003_an_py310.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, client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.3K bytes
    - Viewed (0)
  3. docs/en/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md

        !!! tip
            Prefer to use the `Annotated` version if possible.
    
        ```Python hl_lines="8  13"
        {!> ../../../docs_src/dependencies/tutorial006.py!}
        ```
    
    ### Return values
    
    And they can return values or not, the values won't be used.
    
    So, you can re-use a normal dependency (that returns a value) you already use somewhere else, and even though the value won't be used, the dependency will be executed:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 4.1K bytes
    - Viewed (0)
  4. docs/en/docs/tutorial/query-params.md

    * Data validation
    * Automatic documentation
    
    ## Defaults
    
    As query parameters are not a fixed part of a path, they can be optional and can have default values.
    
    In the example above they have default values of `skip=0` and `limit=10`.
    
    So, going to the URL:
    
    ```
    http://127.0.0.1:8000/items/
    ```
    
    would be the same as going to:
    
    ```
    http://127.0.0.1:8000/items/?skip=0&limit=10
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Oct 20 09:08:42 GMT 2023
    - 5.1K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_query_params_str_validations/test_tutorial013.py

    from docs_src.query_params_str_validations.tutorial013 import app
    
    client = TestClient(app)
    
    
    def test_multi_query_values():
        url = "/items/?q=foo&q=bar"
        response = client.get(url)
        assert response.status_code == 200, response.text
        assert response.json() == {"q": ["foo", "bar"]}
    
    
    def test_query_no_values():
        url = "/items/"
        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)
  6. docs/en/docs/tutorial/encoder.md

    It doesn't return a large `str` containing the data in JSON format (as a string). It returns a Python standard data structure (e.g. a `dict`) with values and sub-values that are all compatible with JSON.
    
    !!! note
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 1.8K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_query_params_str_validations/test_tutorial011.py

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

    from docs_src.query_params_str_validations.tutorial011_an import app
    
    client = TestClient(app)
    
    
    def test_multi_query_values():
        url = "/items/?q=foo&q=bar"
        response = client.get(url)
        assert response.status_code == 200, response.text
        assert response.json() == {"q": ["foo", "bar"]}
    
    
    def test_query_no_values():
        url = "/items/"
        response = client.get(url)
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 3.9K bytes
    - Viewed (0)
  9. docs_src/header_params/tutorial003_an_py310.py

    from typing import Annotated
    
    from fastapi import FastAPI, Header
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(x_token: Annotated[list[str] | None, Header()] = None):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 221 bytes
    - Viewed (0)
  10. docs/en/docs/tutorial/query-params-str-validations.md

    ## Query parameter list / multiple values
    
    When you define a query parameter explicitly with `Query` you can also declare it to receive a list of values, or said in other way, to receive multiple values.
    
    For example, to declare a query parameter `q` that can appear multiple times in the URL, you can write:
    
    === "Python 3.10+"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 25.7K bytes
    - Viewed (0)
Back to top