- Sort Score
- Result 10 results
- Languages All
Results 421 - 430 of 890 for docs_src (0.19 sec)
-
docs/en/docs/tutorial/dependencies/index.md
/// ### Import `Depends` {* ../../docs_src/dependencies/tutorial001_an_py310.py hl[3] *} ### Declare the dependency, in the "dependant" The same way you use `Body`, `Query`, etc. with your *path operation function* parameters, use `Depends` with a new parameter: {* ../../docs_src/dependencies/tutorial001_an_py310.py hl[13,18] *}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Mon Oct 28 11:18:17 UTC 2024 - 9.2K bytes - Viewed (0) -
docs/pt/docs/advanced/response-directly.md
Para esses casos, você pode usar o `jsonable_encoder` para converter seus dados antes de repassá-los para a resposta: ```Python hl_lines="6-7 21-22" {!../../docs_src/response_directly/tutorial001.py!} ``` /// note | Detalhes Técnicos Você também pode utilizar `from starlette.responses import JSONResponse`.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 3.3K bytes - Viewed (0) -
docs/fa/docs/tutorial/middleware.md
* سپس `پاسخ` تولید شده توسط *path operation* مربوطه را برمیگرداند. * شما میتوانید سپس `پاسخ` را تغییر داده و پس از آن را برگردانید. ```Python hl_lines="8-9 11 14" {!../../docs_src/middleware/tutorial001.py!} ``` /// نکته | به خاطر داشته باشید که هدرهای اختصاصی سفارشی را می توان با استفاده از پیشوند "X-" اضافه کرد.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 4.4K bytes - Viewed (0) -
docs/ja/docs/tutorial/first-steps.md
```Python hl_lines="7" {!../../docs_src/first_steps/tutorial001.py!} ``` これは、Pythonの関数です。 この関数は、`GET`オペレーションを使ったURL「`/`」へのリクエストを受け取るたびに**FastAPI**によって呼び出されます。 この場合、この関数は`async`関数です。 --- `async def`の代わりに通常の関数として定義することもできます: ```Python hl_lines="7" {!../../docs_src/first_steps/tutorial003.py!} ``` /// note | "備考"
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 11.1K bytes - Viewed (0) -
tests/test_tutorial/test_testing/test_main.py
from docs_src.app_testing.test_main import client, test_read_main def test_main(): test_read_main() def test_openapi_schema(): response = client.get("/openapi.json") assert response.status_code == 200, response.text assert response.json() == { "openapi": "3.1.0", "info": {"title": "FastAPI", "version": "0.1.0"}, "paths": { "/": { "get": {
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 819 bytes - Viewed (0) -
tests/test_tutorial/test_advanced_middleware/test_tutorial001.py
from fastapi.testclient import TestClient from docs_src.advanced_middleware.tutorial001 import app def test_middleware(): client = TestClient(app, base_url="https://testserver") response = client.get("/") assert response.status_code == 200, response.text client = TestClient(app) response = client.get("/", follow_redirects=False) assert response.status_code == 307, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Nov 13 14:26:09 UTC 2022 - 474 bytes - Viewed (0) -
docs/em/docs/advanced/security/http-basic-auth.md
* ✍ "`security` ⚖" ⚙️ `HTTPBasic`. * ⚙️ 👈 `security` ⏮️ 🔗 👆 *➡ 🛠️*. * ⚫️ 📨 🎚 🆎 `HTTPBasicCredentials`: * ⚫️ 🔌 `username` & `password` 📨. ```Python hl_lines="2 6 10" {!../../docs_src/security/tutorial006.py!} ``` 🕐❔ 👆 🔄 📂 📛 🥇 🕰 (⚖️ 🖊 "🛠️" 🔼 🩺) 🖥 🔜 💭 👆 👆 🆔 & 🔐: <img src="/img/tutorial/security/image12.png"> ## ✅ 🆔 📥 🌅 🏁 🖼. ⚙️ 🔗 ✅ 🚥 🆔 & 🔐 ☑.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 4.1K bytes - Viewed (0) -
docs/en/docs/advanced/middleware.md
Any incoming request to `http` or `ws` will be redirected to the secure scheme instead. {* ../../docs_src/advanced_middleware/tutorial001.py hl[2,6] *} ## `TrustedHostMiddleware` Enforces that all incoming requests have a correctly set `Host` header, in order to guard against HTTP Host Header attacks. {* ../../docs_src/advanced_middleware/tutorial002.py hl[2,6:8] *} The following arguments are supported:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 27 16:45:50 UTC 2024 - 4K bytes - Viewed (0) -
tests/test_tutorial/test_dependencies/test_tutorial008c_an.py
import pytest from fastapi.exceptions import FastAPIError from fastapi.testclient import TestClient @pytest.fixture(name="client") def get_client(): from docs_src.dependencies.tutorial008c_an import app client = TestClient(app) return client def test_get_no_item(client: TestClient): response = client.get("/items/foo") assert response.status_code == 404, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Feb 24 23:06:37 UTC 2024 - 1.1K bytes - Viewed (0) -
tests/test_tutorial/test_async_tests/test_main.py
import pytest from docs_src.async_tests.test_main import test_root @pytest.mark.anyio async def test_async_testing():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Oct 06 15:32:11 UTC 2021 - 143 bytes - Viewed (0)