[ANN] httpx 0.15.0 released

httpx 0.15.0 has been released.

HTTPX.get("HoneyryderChuck / httpx · GitLab
<HoneyryderChuck / httpx · GitLab>")

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), 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

# 0.15.0

## Features

### HTTP response pattern-matching (ruby 3 only)

You can now apply pattern matching in responses:

case response = HTTPX.get("https://google.com")
in { status: 200..399, headers: [*, ["x-special-token", token], *], body: }
  puts "success: #{body.to_s}"
in { status: 400..499, body: }
  puts "client error: #{body.to_s}"
in { status: 500.., body: }
  puts "server error: #{body.to_s}"
in { error: error }
  puts "error: #{error.message}"
  raise "unexpected: #{response}"

### NTLM Authentication

A new plugin, `:ntml_authentication`, is now available. Like the name
suggests, it allows authenticating requests via [NTLM](


ntlm_http = HTTPX.plugin(:ntlm_authentication)

ntlm.ntlm_authentication("user", "password").get("
# or for a specific domain
ntlm.ntlm_authentication("user", "password", "Domain\\User").get("

## Improvemennts

A new timeout option, `settings_timeout`, is supported for the HTTP/2
handshake; after the TCP and TLS handshakes are complete, and initiating
the HTTP/2 handshake, the client terminates the connection with
SETTINGS_TIMEOUT error code, if it doesn't receive the server settings for
the amount of seconds set in `settings_timeout` (by default, 10 seconds).

# if you want to change
HTTPX.with(timeout: {settings_timeout: 5})....

IDNA 2008 support is now possibly, by integrating [idnx](
GitHub - HoneyryderChuck/idnx: Encode and decode internationalized domain names using libidn2, winnls and ruby FFI) into your dependencies:

# in Gemfile
gem "httpx"
gem "idnx"

# 0.14.5

## Bugfixes

* After a connection had been initiated, sending multiple concurrent
requests (ex: `open_httpx.request(req1, req2, req3)`) could freeze; this
happened when the first request would fill the write buffer (like a file
upload request), and the subsequent requests would never be buffered
afterwards; this was fixed by making pending requests flushing a part of a
connection's consumption loop.
* Fixing v0.14.1's fixed bug again; The HTTP/1 "Connection: close" header
was not being set in the last possible request on a connection, due to ann
off-by-one error on connection bookkeeping;
* HTTP/1 connections didn't respect a server-set max nunmber of requests
after a reconnect; Fixed by making this accounting part of the reset

## Chore

* Added regression test suite, which reproduce reported bugs before the fix
(backported all 0.14.x releases here)

# 0.14.4

## Bugfixes

* The HTTP/1 handler was miscalculating the last request for a given
connection, and potentially freezing it.

# 0.14.3

## Bugfixes

* fixed: HTTP/1 "connection: close" header was "leaking" into subsequent
redirect follow, including HTTP/2 requests which would fail due to the
invalid header.

# 0.14.2

## Bugfixes

* fixed: multipart request parts weren't using explicity set `:filename`.

# 0.14.1

## Bugfixes

* fixed: HTTP/2-specific headers were being reused on insecure redirects,
thereby creating an invalid request (#128);
* fixed: multipart request parts weren't using explicity set
`:content_type`, instead using file mime type or "text/plain";