Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 131 - 140 of 395 for item_1 (0.09 seconds)

The search processing time has exceeded the limit. The displayed results may be partial.

  1. README.md

    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        price: float
        is_offer: bool | None = None
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: str | None = None):
        return {"item_id": item_id, "q": q}
    
    
    @app.put("/items/{item_id}")
    def update_item(item_id: int, item: Item):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Mar 07 09:29:03 GMT 2026
    - 24.3K bytes
    - Click Count (0)
  2. docs/zh-hant/docs/index.md

    使用瀏覽器開啟 [http://127.0.0.1:8000/items/5?q=somequery](http://127.0.0.1:8000/items/5?q=somequery)。
    
    你將會看到以下 JSON 回應:
    
    ```JSON
    {"item_id": 5, "q": "somequery"}
    ```
    
    你已經建立了一個具有以下功能的 API:
    
    * 透過路徑 `/` 和 `/items/{item_id}` 接受 HTTP 請求。
    * 以上兩個路徑都接受 `GET` 操作(也被稱為 HTTP _方法_)。
    * 路徑 `/items/{item_id}` 有一個 `int` 型別的路徑參數 `item_id`。
    * 路徑 `/items/{item_id}` 有一個可選的 `str` 查詢參數 `q`。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 20.8K bytes
    - Click Count (0)
  3. fastapi/exceptions.py

        ```python
        from fastapi import FastAPI, HTTPException
    
        app = FastAPI()
    
        items = {"foo": "The Foo Wrestlers"}
    
    
        @app.get("/items/{item_id}")
        async def read_item(item_id: str):
            if item_id not in items:
                raise HTTPException(status_code=404, detail="Item not found")
            return {"item": items[item_id]}
        ```
        """
    
        def __init__(
            self,
            status_code: Annotated[
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Feb 11 18:41:21 GMT 2026
    - 7.3K bytes
    - Click Count (0)
  4. docs_src/query_params_str_validations/tutorial001_py310.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: str | None = None):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 239 bytes
    - Click Count (0)
  5. docs_src/query_params_str_validations/tutorial006_py310.py

    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: str = Query(min_length=3)):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 254 bytes
    - Click Count (0)
  6. tests/test_tutorial/test_bigger_applications/test_main.py

                                },
                            },
                        }
                    },
                    "/items/{item_id}": {
                        "get": {
                            "tags": ["items"],
                            "summary": "Read Item",
                            "operationId": "read_item_items__item_id__get",
                            "parameters": [
                                {
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 22.8K bytes
    - Click Count (0)
  7. docs_src/query_params_str_validations/tutorial009_py310.py

    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: str | None = Query(default=None, alias="item-query")):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 281 bytes
    - Click Count (0)
  8. docs_src/query_params_str_validations/tutorial004_py310.py

    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        q: str | None = Query(
            default=None, min_length=3, max_length=50, pattern="^fixedquery$"
        ),
    ):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 335 bytes
    - Click Count (0)
  9. docs_src/query_params_str_validations/tutorial007_an_py310.py

    from typing import Annotated
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        q: Annotated[str | None, Query(title="Query string", min_length=3)] = None,
    ):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 337 bytes
    - Click Count (0)
  10. docs/tr/docs/tutorial/path-params.md

    {* ../../docs_src/path_params/tutorial001_py310.py hl[6:7] *}
    
    Path parametresi `item_id`'nin değeri, fonksiyonunuza `item_id` argümanı olarak aktarılacaktır.
    
    Yani, bu örneği çalıştırıp [http://127.0.0.1:8000/items/foo](http://127.0.0.1:8000/items/foo) adresine giderseniz, şöyle bir response görürsünüz:
    
    ```JSON
    {"item_id":"foo"}
    ```
    
    ## Tip İçeren Yol Parametreleri { #path-parameters-with-types }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 07:53:17 GMT 2026
    - 9.7K bytes
    - Click Count (0)
Back to Top