1.0.0¶ ↑
Breaking changes¶ ↑
-
the minimum supported ruby version is 2.7.0 .
-
The fallback support for IDNA 2003 has been removed. If you require this feature, install the idnx gem, which
httpxautomatically integrates with when available (and supports IDNA 2008). -
:total_timeoutoption has been removed (no session-wide timeout supported, use:request_timeout). -
:read_timeoutand:write_timeoutare now set to 60 seconds by default, and preferred over:operation_timeout; -
the exception being in the
:streamplugin, as the response is theoretically endless (so:read_timeoutis unset). -
The
:multipartplugin is removed, as its functionality and API are now loaded by default (no API changes). -
The
:compressionplugin is removed, as its functionality and API are now loaded by default (no API changes). -
:compression_threshold_sizewas removed (formats in"content-encoding"request header will always encode the request body). -
the new
:compress_request_bodyand:decompress_response_bodycan be set tofalseto (respectively) disable compression of passed input body, or decompression of the response body. -
:retriesplugin: the:retry_oncondition will not replace default retriable error checks, it will now instead be triggered only if no retryable error has been found.
plugins¶ ↑
-
:authenticationplugin becomes:auth. -
.authenticationhelper becomes.authorization. -
:basic_authenticationplugin becomes:basic_auth. -
:basic_authenticationhelper is removed. -
:digest_authenticationplugin becomes:digest_auth. -
:digest_authenticationhelper is removed. -
:ntlm_authenticationplugin becomes:ntlm_auth. -
:ntlm_authenticationhelper is removed. -
OAuth plugin:
:oauth_authenticationhelper is rename to:oauth_auth. -
:compression/brotliplugin becomes:brotli.
Support removed for deprecated APIs¶ ↑
-
The deprecated
HTTPX::Clientconstant lookup has been removed (useHTTPX::Sessioninstead). -
The deprecated
HTTPX.timeout({...})function has been removed (useHTTPX.with(timeout: {...})instead). -
The deprecated
HTTPX.headers({...})function has been removed (useHTTPX.with(headers: {...})instead). -
The deprecated
HTTPX.plugins(...)function has been removed (useHTTPX.plugin(...).plugin(...)...instead). -
The deprecated
:transport_optionsoption, which was only valid for UNIX connections, has been removed (use:addressesinstead). -
The deprecated
def_option(...)function, previously used to define additional options in plugins, has been removed (usedef option_$new_option)instead). -
The deprecated
:loop_timeouttimeout option has been removed. -
:streamplugin: the deprecatedHTTPX::InstanceMethods::StreamResponsehas been removed (useHTTPX::StreamResponseinstead). -
The deprecated usage of symbols to indicate HTTP verbs (i.e.
HTTPX.request(:get, ...)orHTTPX.build_request(:get, ...)) is not supported anymore (use the upcase string always, i.e.HTTPX.request("GET", ...)orHTTPX.build_request("GET", ...), instead). -
The deprecated
HTTPX::ErrorResponse#statusmethod has been removed (useHTTPX::ErrorResponse#errorinstead).
dependencies¶ ↑
-
http-2-nextminimum supported version is 1.0.0. -
:datadogadapter only supportsddtracegem 1.x or higher. -
:faradayadapter only supportsfaradaygem 1.x or higher.
Improvements¶ ↑
-
circuit_breaker: the drip rate of real request during the “half-open” stage of a circuit will reliably distribute real requests (as per the drip rate) over themax_attempts, before the circuit is closed.
Bugfixes¶ ↑
-
Tempfiles are now correctly identified as file inputs for multipart requests.
-
fixed
proxyplugin behaviour when loaded with thefollow_redirectsplugin and processing a 305 response (request needs to be retried on a different proxy).
Chore¶ ↑
-
:grpcplugin: connection won’t buffer requests before HTTP/2 handshake is commpleted, i.e. works the same as plainhttpxHTTP/2 connection establishment. -
if you are relying on this, you can keep the old behavior this way:
HTTPX.plugin(:grpc, http2_settings: { wait_for_handshake: false }).