Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 268 for item (0.18 sec)

  1. docs/pl/docs/index.md

    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        price: float
        is_offer: Union[bool, None] = None
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    
    
    @app.put("/items/{item_id}")
    def update_item(item_id: int, item: Item):
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Apr 29 05:18:04 GMT 2024
    - 19.4K bytes
    - Viewed (0)
  2. docs/ru/docs/index.md

    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        price: float
        is_offer: Union[bool, None] = None
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    
    
    @app.put("/items/{item_id}")
    def update_item(item_id: int, item: Item):
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Apr 29 05:18:04 GMT 2024
    - 25.8K bytes
    - Viewed (0)
  3. docs/it/docs/index.md

    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        price: float
        is_offer: bool = Optional[None]
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Optional[str] = None):
        return {"item_id": item_id, "q": q}
    
    
    @app.put("/items/{item_id}")
    def update_item(item_id: int, item: Item):
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 23:58:47 GMT 2024
    - 19.3K bytes
    - Viewed (0)
  4. docs/zh/docs/index.md

    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        price: float
        is_offer: Union[bool, None] = None
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    
    
    @app.put("/items/{item_id}")
    def update_item(item_id: int, item: Item):
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Apr 29 05:18:04 GMT 2024
    - 18.2K bytes
    - Viewed (0)
  5. docs/en/docs/external-links.md

    {% for section_name, section_content in external_links.items() %}
    
    ## {{ section_name }}
    
    {% for lang_name, lang_content in section_content.items() %}
    
    ### {{ lang_name }}
    
    {% for item in lang_content %}
    
    * <a href="{{ item.link }}" class="external-link" target="_blank">{{ item.title }}</a> by <a href="{{ item.author_link }}" class="external-link" target="_blank">{{ item.author }}</a>.
    
    {% endfor %}
    {% endfor %}
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Oct 22 07:35:13 GMT 2023
    - 1K bytes
    - Viewed (0)
  6. docs/zh/docs/tutorial/handling-errors.md

    本例中,客户端用 `ID` 请求的 `item` 不存在时,触发状态码为 `404` 的异常:
    
    ```Python hl_lines="11"
    {!../../../docs_src/handling_errors/tutorial001.py!}
    
    ```
    
    ### 响应结果
    
    请求为 `http://example.com/items/foo`(`item_id` 为 `「foo」`)时,客户端会接收到 HTTP 状态码 - 200 及如下 JSON 响应结果:
    
    ```JSON
    {
      "item": "The Foo Wrestlers"
    }
    
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  7. docs/fr/docs/tutorial/path-params.md

    {!../../../docs_src/path_params/tutorial001.py!}
    ```
    
    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
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 10K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/path-params.md

    {!../../../docs_src/path_params/tutorial001.py!}
    ```
    
    The value of the path parameter `item_id` will be passed to your function as the argument `item_id`.
    
    So, if you run this example and go to <a href="http://127.0.0.1:8000/items/foo" class="external-link" target="_blank">http://127.0.0.1:8000/items/foo</a>, you will see a response of:
    
    ```JSON
    {"item_id":"foo"}
    ```
    
    ## Path parameters with types
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  9. docs/ru/docs/tutorial/path-params.md

    {!../../../docs_src/path_params/tutorial001.py!}
    ```
    
    Значение параметра пути `item_id` будет передано в функцию в качестве аргумента `item_id`.
    
    Если запустите этот пример и перейдёте по адресу: <a href="http://127.0.0.1:8000/items/foo" class="external-link" target="_blank">http://127.0.0.1:8000/items/foo</a>, то увидите ответ:
    
    ```JSON
    {"item_id":"foo"}
    ```
    
    ## Параметры пути с типами
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 14.1K bytes
    - Viewed (0)
  10. docs/zh/docs/tutorial/path-params.md

    ```
    
    这段代码把路径参数 `item_id` 的值传递给路径函数的参数 `item_id`。
    
    运行示例并访问 <a href="http://127.0.0.1:8000/items/foo" class="external-link" target="_blank">http://127.0.0.1:8000/items/foo</a>,可获得如下响应:
    
    ```JSON
    {"item_id":"foo"}
    ```
    
    ## 声明路径参数的类型
    
    使用 Python 标准类型注解,声明路径操作函数中路径参数的类型。
    
    ```Python hl_lines="7"
    {!../../../docs_src/path_params/tutorial002.py!}
    ```
    
    本例把 `item_id` 的类型声明为 `int`。
    
    !!! check "检查"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Apr 01 05:35:40 GMT 2024
    - 7.6K bytes
    - Viewed (0)
Back to top