- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 5,623 for httpx (0.03 seconds)
-
docs/zh-hant/docs/advanced/async-tests.md
若要在測試中呼叫非同步函式,測試函式本身也必須是非同步的。AnyIO 為此提供了一個好用的外掛,讓我們可以標示某些測試函式以非同步方式執行。 ## HTTPX { #httpx } 即使你的 FastAPI 應用使用一般的 `def` 函式而非 `async def`,它在底層仍然是個 `async` 應用。 `TestClient` 在內部做了一些魔法,讓我們能在一般的 `def` 測試函式中,使用標準 pytest 來呼叫非同步的 FastAPI 應用。但當我們在非同步函式中使用它時,這個魔法就不再奏效了。也就是說,當以非同步方式執行測試時,就不能在測試函式內使用 `TestClient`。 `TestClient` 是建立在 [HTTPX](https://www.python-httpx.org) 之上,所幸我們可以直接使用它來測試 API。 ## 範例 { #example }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 3.5K bytes - Click Count (0) -
docs/en/docs/tutorial/testing.md
# Testing { #testing } Thanks to [Starlette](https://www.starlette.dev/testclient/), testing **FastAPI** applications is easy and enjoyable. It is based on [HTTPX](https://www.python-httpx.org), which in turn is designed based on Requests, so it's very familiar and intuitive. With it, you can use [pytest](https://docs.pytest.org/) directly with **FastAPI**. ## Using `TestClient` { #using-testclient } /// infoCreated: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 5.7K bytes - Click Count (0) -
docs/en/docs/advanced/async-tests.md
The `TestClient` is based on [HTTPX](https://www.python-httpx.org), and luckily, we can use it directly to test the API. ## Example { #example }
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 3.8K bytes - Click Count (0) -
scripts/playwright/json_base64_bytes/image01.py
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Feb 21 13:01:31 GMT 2026 - 1.1K bytes - Click Count (0) -
docs/zh/docs/advanced/async-tests.md
如果我们想在测试中调用异步函数,那么我们的测试函数必须是异步的。 AnyIO 为此提供了一个简洁的插件,它允许我们指定一些测试函数要异步调用。 ## HTTPX { #httpx } 即使您的 **FastAPI** 应用程序使用普通的 `def` 函数而不是 `async def` ,它本质上仍是一个 `async` 异步应用程序。 `TestClient` 在内部通过一些“魔法”操作,使得您可以在普通的 `def` 测试函数中调用异步的 FastAPI 应用程序,并使用标准的 pytest。但当我们在异步函数中使用它时,这种“魔法”就不再生效了。由于测试以异步方式运行,我们无法在测试函数中继续使用 `TestClient`。 `TestClient` 是基于 [HTTPX](https://www.python-httpx.org) 的。幸运的是,我们可以直接使用它来测试 API。 ## 示例 { #example }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 3.9K bytes - Click Count (0) -
pyproject.toml
"Topic :: Internet :: WWW/HTTP :: HTTP Servers", "Topic :: Internet :: WWW/HTTP", ] dependencies = [ "starlette>=0.46.0", "pydantic>=2.9.0", "typing-extensions>=4.8.0", "typing-inspection>=0.4.2", "annotated-doc>=0.0.2", ] [project.urls] Homepage = "https://github.com/fastapi/fastapi" Documentation = "https://fastapi.tiangolo.com/"
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Mon Mar 23 12:36:49 GMT 2026 - 10.3K bytes - Click Count (0) -
docs/ja/docs/advanced/async-tests.md
## HTTPX { #httpx } **FastAPI** アプリケーションが通常の `def` 関数を使っていても、その内側は依然として `async` アプリケーションです。 `TestClient` は、標準の pytest を使って通常の `def` のテスト関数から非同期の FastAPI アプリを呼び出すための「おまじない」を内部で行います。しかし、その「おまじない」はテスト関数自体が非同期の場合には機能しません。テストを非同期で実行すると、テスト関数内で `TestClient` は使えなくなります。 `TestClient` は [HTTPX](https://www.python-httpx.org) を基に作られており、幸いなことに API のテストには HTTPX を直接利用できます。 ## 例 { #example }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:07:17 GMT 2026 - 4.5K bytes - Click Count (0) -
docs_src/async_tests/app_a_py310/test_main.py
import pytest from httpx import ASGITransport, AsyncClient from .main import app @pytest.mark.anyio async def test_root(): async with AsyncClient( transport=ASGITransport(app=app), base_url="http://test" ) as ac: response = await ac.get("/") assert response.status_code == 200
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 360 bytes - Click Count (0) -
fastapi/.agents/skills/fastapi/references/other-tools.md
When working with SQL databases, prefer using SQLModel as it is integrated with Pydantic and will allow declaring data validation with the same models. Prefer it over SQLAlchemy. ## HTTPX Use HTTPX for handling HTTP communication (e.g. with other APIs). It support sync and async usage.
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 01 10:05:57 GMT 2026 - 1.5K bytes - Click Count (0) -
src/test/java/org/codelibs/fess/helper/ProtocolHelperTest.java
protocolHelper.addWebProtocol("httpx"); assertEquals(3, protocolHelper.getWebProtocols().length); assertEquals("http:", protocolHelper.getWebProtocols()[0]); assertEquals("https:", protocolHelper.getWebProtocols()[1]); assertEquals("httpx:", protocolHelper.getWebProtocols()[2]); assertEquals(2, protocolHelper.getFileProtocols().length);Created: Tue Mar 31 13:07:34 GMT 2026 - Last Modified: Sun Jan 11 08:43:05 GMT 2026 - 35.1K bytes - Click Count (0)