Search Options

Results per page
Sort
Preferred Languages
Advance

Results 161 - 170 of 378 for item_2 (0.04 sec)

  1. docs/fr/docs/tutorial/path-params.md

    
    {* ../../docs_src/path_params/tutorial001.py hl[6:7] *}
    
    La valeur du paramètre `item_id` sera transmise à la fonction dans l'argument `item_id`.
    
    Donc, si vous exécutez cet exemple et allez sur <a href="http://127.0.0.1:8000/items/foo" class="external-link" target="_blank">http://127.0.0.1:8000/items/foo</a>,
    vous verrez comme réponse :
    
    ```JSON
    {"item_id":"foo"}
    ```
    
    ## Paramètres de chemin typés
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Nov 09 16:39:20 UTC 2024
    - 9.8K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_path_params_numeric_validations/test_tutorial002_tutorial003.py

        )
        return TestClient(mod.app)
    
    
    @pytest.mark.parametrize(
        "path,expected_response",
        [
            ("/items/42?q=", {"item_id": 42}),
            ("/items/123?q=somequery", {"item_id": 123, "q": "somequery"}),
        ],
    )
    def test_read_items(client: TestClient, path, expected_response):
        response = client.get(path)
        assert response.status_code == 200, response.text
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 5.6K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_handling_errors/test_tutorial004.py

    client = TestClient(app)
    
    
    def test_get_validation_error():
        response = client.get("/items/foo")
        assert response.status_code == 400, response.text
        assert "Validation errors:" in response.text
        assert "Field: ('path', 'item_id')" in response.text
    
    
    def test_get_http_error():
        response = client.get("/items/3")
        assert response.status_code == 418, response.text
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 3.4K bytes
    - Viewed (0)
  4. docs/de/docs/tutorial/path-params.md

    Der Wert des Pfad-Parameters `item_id` wird Ihrer Funktion als das Argument `item_id` übergeben.
    
    Wenn Sie dieses Beispiel ausführen und auf <a href="http://127.0.0.1:8000/items/foo" class="external-link" target="_blank">http://127.0.0.1:8000/items/foo</a> gehen, sehen Sie als <abbr title="Response – Antwort: Daten, die der Server zum anfragenden Client zurücksendet">Response</abbr>:
    
    ```JSON
    {"item_id":"foo"}
    ```
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 10.5K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_body_multiple_params/test_tutorial002.py

            },
            "openapi": "3.1.0",
            "paths": {
                "/items/{item_id}": {
                    "put": {
                        "operationId": "update_item_items__item_id__put",
                        "parameters": [
                            {
                                "in": "path",
                                "name": "item_id",
                                "required": True,
                                "schema": {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 11K bytes
    - Viewed (0)
  6. docs_src/python_types/tutorial007_py39.py

    def process_items(items_t: tuple[int, int, str], items_s: set[bytes]):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Jan 07 14:11:31 UTC 2022
    - 99 bytes
    - Viewed (0)
  7. docs/tr/docs/tutorial/path-params.md

    {* ../../docs_src/path_params/tutorial001.py hl[6:7] *}
    
    Yol parametresi olan `item_id`'nin değeri, fonksiyonunuza `item_id` argümanı olarak aktarılacaktır.
    
    Eğer bu örneği çalıştırıp <a href="http://127.0.0.1:8000/items/foo" class="external-link" target="_blank">http://127.0.0.1:8000/items/foo</a> sayfasına giderseniz, şöyle bir çıktı ile karşılaşırsınız:
    
    ```JSON
    {"item_id":"foo"}
    ```
    
    ## Tip İçeren Yol Parametreleri
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sun Aug 31 10:29:01 UTC 2025
    - 10.5K bytes
    - Viewed (0)
  8. docs_src/query_params_str_validations/tutorial006c_py310.py

    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: str | None = Query(min_length=3)):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Feb 15 16:23:59 UTC 2025
    - 261 bytes
    - Viewed (0)
  9. tests/test_tutorial/test_query_params/test_tutorial005.py

    client = TestClient(app)
    
    
    def test_foo_needy_very():
        response = client.get("/items/foo?needy=very")
        assert response.status_code == 200
        assert response.json() == {"item_id": "foo", "needy": "very"}
    
    
    def test_foo_no_needy():
        response = client.get("/items/foo")
        assert response.status_code == 422
        assert response.json() == {
            "detail": [
                {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 3.6K bytes
    - Viewed (0)
  10. docs_src/query_params_str_validations/tutorial001_py39.py

    from typing import Union
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: Union[str, None] = None):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 271 bytes
    - Viewed (0)
Back to top