Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 121 - 130 of 1,076 for itemId (0.14 seconds)

  1. docs_src/app_testing/app_b_py310/main.py

        return fake_db[item_id]
    
    
    @app.post("/items/")
    async def create_item(item: Item, x_token: str = Header()) -> Item:
        if x_token != fake_secret_token:
            raise HTTPException(status_code=400, detail="Invalid X-Token header")
        if item.id in fake_db:
            raise HTTPException(status_code=409, detail="Item already exists")
        fake_db[item.id] = item.model_dump()
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Feb 04 13:32:24 GMT 2026
    - 1.1K bytes
    - Click Count (0)
  2. 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)
  3. docs/ko/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`를 가지고 있습니다.
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:06:26 GMT 2026
    - 23.4K bytes
    - Click Count (0)
  4. 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)
  5. docs_src/body/tutorial003_py310.py

    from fastapi import FastAPI
    from pydantic import BaseModel
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
    
    
    app = FastAPI()
    
    
    @app.put("/items/{item_id}")
    async def update_item(item_id: int, item: Item):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Dec 20 15:55:38 GMT 2025
    - 330 bytes
    - Click Count (0)
  6. docs/uk/docs/tutorial/path-params.md

    {* ../../docs_src/path_params/tutorial001_py310.py hl[6:7] *}
    
    Значення параметра шляху `item_id` буде передано у вашу функцію як аргумент `item_id`.
    
    Отже, якщо ви запустите цей приклад і перейдете за посиланням [http://127.0.0.1:8000/items/foo](http://127.0.0.1:8000/items/foo), то побачите відповідь:
    
    ```JSON
    {"item_id":"foo"}
    ```
    
    ## Параметри шляху з типами { #path-parameters-with-types }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:27:41 GMT 2026
    - 14K bytes
    - Click Count (0)
  7. docs/fr/docs/index.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: Thu Mar 19 18:37:13 GMT 2026
    - 23.8K bytes
    - Click Count (0)
  8. internal/store/queuestore.go

    	}
    
    	return raw, err
    }
    
    // Get - gets an item from the store.
    func (store *QueueStore[I]) Get(key Key) (item I, err error) {
    	items, err := store.GetMultiple(key)
    	if err != nil {
    		return item, err
    	}
    	return items[0], nil
    }
    
    // GetMultiple will read the multi payload file and fetch the items
    func (store *QueueStore[I]) GetMultiple(key Key) (items []I, err error) {
    	raw, err := store.GetRaw(key)
    Created: Sun Apr 05 19:28:12 GMT 2026
    - Last Modified: Sun Sep 28 20:59:21 GMT 2025
    - 7.8K bytes
    - Click Count (0)
  9. docs_src/query_params/tutorial004_py310.py

    
    @app.get("/users/{user_id}/items/{item_id}")
    async def read_user_item(
        user_id: int, item_id: str, q: str | None = None, short: bool = False
    ):
        item = {"item_id": item_id, "owner_id": user_id}
        if q:
            item.update({"q": q})
        if not short:
            item.update(
                {"description": "This is an amazing item that has a long description"}
            )
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 436 bytes
    - Click Count (0)
  10. docs_src/schema_extra_example/tutorial002_py310.py

    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str = Field(examples=["Foo"])
        description: str | None = Field(default=None, examples=["A very nice Item"])
        price: float = Field(examples=[35.4])
        tax: float | None = Field(default=None, examples=[3.2])
    
    
    @app.put("/items/{item_id}")
    async def update_item(item_id: int, item: Item):
        results = {"item_id": item_id, "item": item}
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 479 bytes
    - Click Count (0)
Back to Top