Search Options

Results per page
Sort
Preferred Languages
Advance

Results 301 - 310 of 540 for item_d (0.03 sec)

  1. docs/zh/docs/tutorial/handling-errors.md

    在介绍依赖项与安全的章节中,您可以了解更多用 `raise` 异常代替 `return` 值的优势。
    
    本例中,客户端用 `ID` 请求的 `item` 不存在时,触发状态码为 `404` 的异常:
    
    {* ../../docs_src/handling_errors/tutorial001.py hl[11] *}
    
    ### 响应结果
    
    请求为 `http://example.com/items/foo`(`item_id` 为 `「foo」`)时,客户端会接收到 HTTP 状态码 - 200 及如下 JSON 响应结果:
    
    ```JSON
    {
      "item": "The Foo Wrestlers"
    }
    
    ```
    
    但如果客户端请求 `http://example.com/items/bar`(`item_id` `「bar」` 不存在时),则会接收到 HTTP 状态码 - 404(「未找到」错误)及如下 JSON 响应结果:
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Oct 11 17:48:49 UTC 2025
    - 8.2K bytes
    - Viewed (0)
  2. src/test/java/org/codelibs/core/io/SerializeUtilTest.java

            assertEquals(arr.length, result.length);
            assertEquals(arr[0], result[0]);
    
            // Test ArrayList
            final List<String> list = new ArrayList<>();
            list.add("item1");
            list.add("item2");
            binary = SerializeUtil.fromObjectToBinary(list);
            @SuppressWarnings("unchecked")
            final List<String> resultList = (List<String>) SerializeUtil.fromBinaryToObject(binary);
    Registered: Sat Dec 20 08:55:33 UTC 2025
    - Last Modified: Sat Nov 22 11:21:59 UTC 2025
    - 7.6K bytes
    - Viewed (0)
  3. docs_src/custom_response/tutorial001_py39.py

    from fastapi import FastAPI
    from fastapi.responses import UJSONResponse
    
    app = FastAPI()
    
    
    @app.get("/items/", response_class=UJSONResponse)
    async def read_items():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 197 bytes
    - Viewed (0)
  4. docs/zh/docs/tutorial/query-params.md

    本例中,访问:
    
    ```
    http://127.0.0.1:8000/items/foo?short=1
    ```
    
    或
    
    ```
    http://127.0.0.1:8000/items/foo?short=True
    ```
    
    或
    
    ```
    http://127.0.0.1:8000/items/foo?short=true
    ```
    
    或
    
    ```
    http://127.0.0.1:8000/items/foo?short=on
    ```
    
    或
    
    ```
    http://127.0.0.1:8000/items/foo?short=yes
    ```
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  5. docs/pt/docs/tutorial/handling-errors.md

    {
      "item": "The Foo Wrestlers"
    }
    ```
    
    Mas se o cliente faz uma requisição para `http://example.com/items/bar` (ou seja, um não existente `item_id "bar"`), esse cliente receberá um HTTP status code 404 (o erro "não encontrado" — *not found error*), e uma resposta JSON:
    
    ```JSON
    {
      "detail": "Item not found"
    }
    ```
    
    /// tip | Dica
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 10.2K bytes
    - Viewed (0)
  6. docs/es/docs/tutorial/handling-errors.md

    ```JSON
    {
      "item": "The Foo Wrestlers"
    }
    ```
    
    Pero si el cliente solicita `http://example.com/items/bar` (un `item_id` inexistente `"bar"`), ese cliente recibirá un código de estado HTTP de 404 (el error "no encontrado"), y un response JSON de:
    
    ```JSON
    {
      "detail": "Item not found"
    }
    ```
    
    /// tip | Consejo
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 9.7K bytes
    - Viewed (0)
  7. docs/uk/docs/tutorial/query-params.md

        }
      ]
    }
    ```
    
    Оскільки `needy` є обов’язковим параметром, вам потрібно вказати його в URL:
    
    ```
    http://127.0.0.1:8000/items/foo-item?needy=sooooneedy
    ```
    
    ...цей запит поверне:
    
    ```JSON
    {
        "item_id": "foo-item",
        "needy": "sooooneedy"
    }
    ```
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sun Aug 31 10:29:01 UTC 2025
    - 7.2K bytes
    - Viewed (0)
  8. docs_src/pydantic_v1_in_v2/tutorial003_an_py310.py

    from pydantic.v1 import BaseModel
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
        size: float
    
    
    class ItemV2(BaseModelV2):
        name: str
        description: str | None = None
        size: float
    
    
    app = FastAPI()
    
    
    @app.post("/items/", response_model=ItemV2)
    async def create_item(item: Item):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Oct 11 16:45:54 UTC 2025
    - 407 bytes
    - Viewed (0)
  9. tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial002.py

    from docs_src.path_operation_advanced_configuration.tutorial002_py39 import app
    
    client = TestClient(app)
    
    
    def test_get():
        response = client.get("/items/")
        assert response.status_code == 200, response.text
        assert response.json() == [{"item_id": "Foo"}]
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 1K bytes
    - Viewed (0)
  10. docs/en/docs/tutorial/query-params.md

          "input": null
        }
      ]
    }
    ```
    
    As `needy` is a required parameter, you would need to set it in the URL:
    
    ```
    http://127.0.0.1:8000/items/foo-item?needy=sooooneedy
    ```
    
    ...this would work:
    
    ```JSON
    {
        "item_id": "foo-item",
        "needy": "sooooneedy"
    }
    ```
    
    And of course, you can define some parameters as required, some as having a default value, and some entirely optional:
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 4.5K bytes
    - Viewed (0)
Back to top