You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: Rename the HTTPX extra and clients to httpx2 (#1048)
Renames the optional extra `httpx` to `httpx2`, and `HttpxHttpClient` /
`HttpxHttpClientAsync` to `Httpx2HttpClient` / `Httpx2HttpClientAsync`,
along with the private module, the docs examples, and the test ids. Once
httpx releases 1.0 with a new API, an extra named `httpx` that installs
`httpx2` would confuse users (see
#1046 (comment)).
Neither name has shipped in a stable release, so nothing is breaking.
Kept as is: the `import httpx2 as httpx` alias inside the module,
"HTTPX" as the library name in prose, and the historical v2 upgrade
note.
Follows up on #1046.
*✍️ Drafted by Claude Code*
Copy file name to clipboardExpand all lines: docs/01_introduction/index.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,12 +63,12 @@ For better request-body compression, opt in to `brotli`, which compresses better
63
63
64
64
For details, see [HTTP compression](../02_concepts/13_http_compression.mdx).
65
65
66
-
The client uses [Impit](https://github.com/apify/impit) as its default HTTP transport. To use the built-in [HTTPX](https://github.com/pydantic/httpx2) transport, install the optional `httpx` extra. The extra installs `httpx2`, Pydantic's maintained continuation of HTTPX:
66
+
The client uses [Impit](https://github.com/apify/impit) as its default HTTP transport. To use the built-in [HTTPX](https://github.com/pydantic/httpx2) transport, install the optional `httpx2` extra, which provides Pydantic's maintained continuation of HTTPX:
@@ -47,30 +47,30 @@ You can configure the default client through the <ApiLink to="class/ApifyClient"
47
47
48
48
## Built-in HTTPX client
49
49
50
-
The package also provides <ApiLinkto="class/HttpxHttpClient">`HttpxHttpClient`</ApiLink> and <ApiLinkto="class/HttpxHttpClientAsync">`HttpxHttpClientAsync`</ApiLink>. They use the same request preparation, compression, retry policy, timeout tiers and growth, error handling, logging, and statistics as the default Impit clients, with [HTTPX](https://github.com/pydantic/httpx2) as the transport.
50
+
The package also provides <ApiLinkto="class/Httpx2HttpClient">`Httpx2HttpClient`</ApiLink> and <ApiLinkto="class/Httpx2HttpClientAsync">`Httpx2HttpClientAsync`</ApiLink>. They use the same request preparation, compression, retry policy, timeout tiers and growth, error handling, logging, and statistics as the default Impit clients, with [HTTPX](https://github.com/pydantic/httpx2) as the transport.
51
51
52
-
HTTPX is an optional dependency. Install `apify-client[httpx]`, then pass the appropriate client to <ApiLinkto="class/ApifyClient#with_custom_http_client">`ApifyClient.with_custom_http_client`</ApiLink>. The extra installs `httpx2`, Pydantic's maintained continuation of HTTPX. Impit remains the default even when the HTTPX extra is installed.
52
+
HTTPX is an optional dependency provided by the `httpx2` package, Pydantic's maintained continuation of HTTPX. Install `apify-client[httpx2]`, then pass the appropriate client to <ApiLinkto="class/ApifyClient#with_custom_http_client">`ApifyClient.with_custom_http_client`</ApiLink>. Impit remains the default even when the extra is installed.
Configure retries, timeout tiers, default headers, and compression on the HTTPX client instance. The token passed to `with_custom_http_client` is applied automatically unless the HTTP client already has an `Authorization` header. The examples use the clients as context managers so their connection pools are closed deterministically. If a context manager doesn't fit your application's lifecycle, call `close()` on `HttpxHttpClient` or `await aclose()` on `HttpxHttpClientAsync` during shutdown.
73
+
Configure retries, timeout tiers, default headers, and compression on the HTTPX client instance. The token passed to `with_custom_http_client` is applied automatically unless the HTTP client already has an `Authorization` header. The examples use the clients as context managers so their connection pools are closed deterministically. If a context manager doesn't fit your application's lifecycle, call `close()` on `Httpx2HttpClient` or `await aclose()` on `Httpx2HttpClientAsync` during shutdown.
74
74
75
75
Timeout values are passed to the selected transport. Impit enforces them as a deadline for the whole request, body included. HTTPX applies them to each socket operation instead, so a response whose body arrives slowly keeps resetting the timeout and can outlast both the requested timeout and `timeout_max`. The `no_timeout` option disables HTTPX's timeouts.
0 commit comments