RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

[ANN] httpx 0.24.0 released

httpx 0.24.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:

0.24.0 Features :oauth plugin

The :oauth plugin manages the handling of a given OAuth session, in that it ships with convenience methods to generate a new access token, which it then injects in all requests.

More info under https://honeyryderchuck.gitlab.io/httpx/wiki/OAuth

session callbacks

HTTP request/response lifecycle events have now the ability of being intercepted via public API callback methods:

ruby HTTPX.on_request_completed do |request| puts "request to #{request.uri} sent" end.get(...)

More info under https://honeyryderchuck.gitlab.io/httpx/wiki/Events to know which events and callback methods are supported.

:circuit_breaker plugin on_circuit_open callback

A callback has been introduced for the :circuit_breaker plugin, which is triggered when a circuit is opened.

ruby http = HTTPX.plugin(:circuit_breaker).on_circuit_open do |req| puts "circuit opened for #{req.uri}" end http.get(...)

Improvements

Several :response_cache features have been improved:

  • :response_cache plugin: response cache store has been made thread-safe.
  • cached response sharing across threads is made safer, as stringio/tempfile instances are copied instead of shared (without copying the underling string/file).
  • stale cached responses are eliminate on cache store lookup/store operations.
  • already closed responses are evicted from the cache store.
  • fallback for lack of compatible response “date” header has been fixed to return a Time object.
Bugfixes
  • Ability to recover from errors happening during response chunk processing (required for overriding behaviour and response chunk callbacks); error bubbling up will result in the connection being closed.
  • Happy eyeballs support for multi-homed early-resolved domain names (such as localhost under /etc/hosts) was broken, as it would try the first given IP; so, if given ::1 and connection would fail, it wouldn’t try 127.0.0.1, which would have succeeded.
  • :digest_authentication plugin was removing the “algorithm” header on -sess declared algorithms, which is required for HTTP digest auth negotiation.
0.23.4 Bugfixes
  • fix Response::Body#read which rewinds on every call.
0.23.3 Bugfixes
  • native resolver: fix missing exception variable in the DNS error code path.
  • native resolver: fixed short DNS packet handling when using TCP.
0.23.2 Bugfixes
  • fix missing variable on code path in the native resolver.
0.23.1 Bugfixes
  • fixed regression causing dns candidate names not being tried after first one fails.

Comments

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in