- Sort Score
- Result 10 results
- Languages All
Results 351 - 360 of 593 for item_2 (0.07 sec)
-
tests/test_tutorial/test_custom_response/test_tutorial001b.py
from docs_src.custom_response.tutorial001b import app client = TestClient(app) def test_get_custom_response(): 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 Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 1K bytes - Viewed (0) -
docs/en/docs/tutorial/handling-errors.md
{ "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`.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 9.1K bytes - Viewed (0) -
tests/test_tutorial/test_custom_response/test_tutorial001.py
from docs_src.custom_response.tutorial001 import app client = TestClient(app) def test_get_custom_response(): 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 Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 1K bytes - Viewed (0) -
tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial002.py
from docs_src.path_operation_advanced_configuration.tutorial002 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 Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 1020 bytes - Viewed (0) -
docs/ja/docs/tutorial/path-params-numeric-validations.md
## Pathのインポート まず初めに、`fastapi`から`Path`をインポートします: ```Python hl_lines="1" {!../../docs_src/path_params_numeric_validations/tutorial001.py!} ``` ## メタデータの宣言 パラメータは`Query`と同じものを宣言することができます。 例えば、パスパラメータ`item_id`に対して`title`のメタデータを宣言するには以下のようにします: ```Python hl_lines="8" {!../../docs_src/path_params_numeric_validations/tutorial001.py!} ``` /// note | "備考" パスの一部でなければならないので、パスパラメータは常に必須です。
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 6.1K bytes - Viewed (0) -
docs/ru/docs/tutorial/path-params-numeric-validations.md
/// ## Определите метаданные Вы можете указать все те же параметры, что и для `Query`. Например, чтобы указать значение метаданных `title` для path-параметра `item_id`, вы можете написать: //// tab | Python 3.10+ ```Python hl_lines="10" {!> ../../docs_src/path_params_numeric_validations/tutorial001_an_py310.py!} ``` //// //// tab | Python 3.9+
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 14.1K bytes - Viewed (0) -
docs_src/custom_response/tutorial001.py
from fastapi import FastAPI from fastapi.responses import UJSONResponse app = FastAPI() @app.get("/items/", response_class=UJSONResponse) async def read_items():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Mar 26 19:09:53 UTC 2020 - 197 bytes - Viewed (0) -
docs_src/custom_response/tutorial010.py
from fastapi import FastAPI from fastapi.responses import ORJSONResponse app = FastAPI(default_response_class=ORJSONResponse) @app.get("/items/") async def read_items():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Jun 13 16:02:45 UTC 2020 - 205 bytes - Viewed (0) -
docs_src/custom_response/tutorial001b.py
from fastapi import FastAPI from fastapi.responses import ORJSONResponse app = FastAPI() @app.get("/items/", response_class=ORJSONResponse) async def read_items():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Sep 01 09:59:05 UTC 2022 - 215 bytes - Viewed (0) -
docs/uk/docs/python-types.md
//// //// tab | Python 3.9 і вище ```Python hl_lines="1" {!> ../../docs_src/python_types/tutorial007_py39.py!} ``` //// Це означає: * Змінна `items_t` це `tuple` з 3 елементами, `int`, ще `int`, та `str`. * Змінна `items_s` це `set`, і кожен його елемент типу `bytes`. #### Dict (словник) Щоб оголосити `dict`, вам потрібно передати 2 параметри типу, розділені комами.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 19.5K bytes - Viewed (0)