Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 221 - 230 of 445 for item_1 (0.05 seconds)

  1. docs/fr/docs/python-types.md

    ///
    
    Cela signifie : « la variable `items` est une `list`, et chacun des éléments de cette liste est un `str` ».
    
    En faisant cela, votre éditeur peut vous fournir de l'aide même pendant le traitement des éléments de la liste :
    
    <img src="/img/python-types/image05.png">
    
    Sans types, c'est presque impossible à réaliser.
    
    Remarquez que la variable `item` est l'un des éléments de la liste `items`.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:37:13 GMT 2026
    - 12.7K bytes
    - Click Count (0)
  2. docs_src/path_operation_configuration/tutorial006_py310.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/items/", tags=["items"])
    async def read_items():
        return [{"name": "Foo", "price": 42}]
    
    
    @app.get("/users/", tags=["users"])
    async def read_users():
        return [{"username": "johndoe"}]
    
    
    @app.get("/elements/", tags=["items"], deprecated=True)
    async def read_elements():
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 365 bytes
    - Click Count (0)
  3. docs/zh-hant/docs/tutorial/query-params.md

          "input": null
        }
      ]
    }
    ```
    
    由於 `needy` 是必填參數,你需要在 URL 中設定它:
    
    ```
    http://127.0.0.1:8000/items/foo-item?needy=sooooneedy
    ```
    
    ...這樣就會成功:
    
    ```JSON
    {
        "item_id": "foo-item",
        "needy": "sooooneedy"
    }
    ```
    
    當然,你可以同時定義部分參數為必填、部分有預設值、部分為選填:
    
    {* ../../docs_src/query_params/tutorial006_py310.py hl[8] *}
    
    在此例中,有 3 個查詢參數:
    
    * `needy`,必填的 `str`。
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 4.1K bytes
    - Click Count (0)
  4. docs/en/docs/tutorial/handling-errors.md

    ```JSON
    {
      "item": "The Foo Wrestlers"
    }
    ```
    
    But if the client requests `http://example.com/items/bar` (a non-existent `item_id` `"bar"`), that client will receive an HTTP status code of 404 (the "not found" error), and a JSON response of:
    
    ```JSON
    {
      "detail": "Item not found"
    }
    ```
    
    /// tip
    
    When raising an `HTTPException`, you can pass any value that can be converted to JSON as the parameter `detail`, not only `str`.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 8.9K bytes
    - Click Count (0)
  5. docs_src/custom_response/tutorial001_py310.py

    from fastapi import FastAPI
    from fastapi.responses import UJSONResponse
    
    app = FastAPI()
    
    
    @app.get("/items/", response_class=UJSONResponse)
    async def read_items():
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 197 bytes
    - Click Count (0)
  6. docs/zh-hant/docs/tutorial/handling-errors.md

    ### 回應結果 { #the-resulting-response }
    
    如果用戶端請求 `http://example.com/items/foo`(`item_id` 為 `"foo"`),會收到 200 的 HTTP 狀態碼,以及以下 JSON 回應:
    
    ```JSON
    {
      "item": "The Foo Wrestlers"
    }
    ```
    
    但如果用戶端請求 `http://example.com/items/bar`(不存在的 `item_id` `"bar"`),會收到 404("not found")的 HTTP 狀態碼,以及以下 JSON 回應:
    
    ```JSON
    {
      "detail": "Item not found"
    }
    ```
    
    /// tip
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 8.3K bytes
    - Click Count (0)
  7. fastapi/.agents/skills/fastapi/SKILL.md

    app = FastAPI()
    
    
    @app.get("/items/{item_id}")
    async def read_item(
        item_id: Annotated[int, Path(ge=1, description="The item ID")],
        q: Annotated[str | None, Query(max_length=50)] = None,
    ):
        return {"message": "Hello World"}
    ```
    
    instead of:
    
    ```python
    # DO NOT DO THIS
    @app.get("/items/{item_id}")
    async def read_item(
        item_id: int = Path(ge=1, description="The item ID"),
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 01 10:05:57 GMT 2026
    - 10.1K bytes
    - Click Count (0)
  8. fastapi/routing.py

            from pydantic import BaseModel
    
            class Item(BaseModel):
                name: str
                description: str | None = None
    
            app = FastAPI()
            router = APIRouter()
    
            @router.put("/items/{item_id}")
            def replace_item(item_id: str, item: Item):
                return {"message": "Item replaced", "id": item_id}
    
            app.include_router(router)
            ```
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 15 11:44:39 GMT 2026
    - 193K bytes
    - Click Count (0)
  9. docs/ko/docs/tutorial/query-params.md

          "input": null
        }
      ]
    }
    ```
    
    `needy`는 필수 매개변수이므로 URL에 반드시 설정해줘야 합니다:
    
    ```
    http://127.0.0.1:8000/items/foo-item?needy=sooooneedy
    ```
    
    ...아래처럼 작동합니다:
    
    ```JSON
    {
        "item_id": "foo-item",
        "needy": "sooooneedy"
    }
    ```
    
    그리고 물론, 일부 매개변수는 필수로, 다른 일부는 기본값을, 또 다른 일부는 선택적으로 선언할 수 있습니다:
    
    {* ../../docs_src/query_params/tutorial006_py310.py hl[8] *}
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:06:26 GMT 2026
    - 5K bytes
    - Click Count (0)
  10. docs/tr/docs/tutorial/query-params.md

    Bu durumda, şuraya giderseniz:
    
    ```
    http://127.0.0.1:8000/items/foo?short=1
    ```
    
    veya
    
    ```
    http://127.0.0.1:8000/items/foo?short=True
    ```
    
    veya
    
    ```
    http://127.0.0.1:8000/items/foo?short=true
    ```
    
    veya
    
    ```
    http://127.0.0.1:8000/items/foo?short=on
    ```
    
    veya
    
    ```
    http://127.0.0.1:8000/items/foo?short=yes
    ```
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 07:53:17 GMT 2026
    - 4.9K bytes
    - Click Count (0)
Back to Top