[ANN] httpx 1.0.0 released
httpx 1.0.0 has been released.
HTTPX.get("https://gitlab.com/honeyryderchuck/httpx")
HTTPX is an HTTP client library for the Ruby programming language.
Among its features, it supports:
- HTTP/2 and HTTP/1.x protocol versions
- Concurrent requests by default
- Simple and chainable API
- Proxy Support (HTTP(S), CONNECT tunnel, Socks4/4a/5)
- Simple Timeout System
- Lightweight by default (require what you need)
And also:
- Compression (gzip, deflate, brotli)
- Streaming Requests
- Authentication (Basic Auth, Digest Auth, AWS Sigv4)
- Expect 100-continue
- Multipart Requests
- Cookies
- HTTP/2 Server Push
- H2C Upgrade
- Automatic follow redirects
- International Domain Names
- GRPC
- Circuit breaker
- WebDAV
- Datadog integration
- Faraday integration
- Webmock integration
- Sentry integration
Here are the updates since the last release:
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 exception being in the
- 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.
-
: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.
- 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).
-
http-2-nextminimum supported version is 1.0.0. -
:datadogadapter only supportsddtracegem 1.x or higher. -
:faradayadapter only supportsfaradaygem 1.x or higher.
-
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.
- 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).
-
: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 }).
- if you are relying on this, you can keep the old behavior this way:
Post a comment