Sha256: e4fe0da18ac53fb240d3021798355c1e78bff744c73af457601ce47022e57d45

Contents?: true

Size: 1.46 KB

Versions: 1

Compression:

Stored size: 1.46 KB

Contents

# 0.15.0

## Features

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

You can now apply pattern matching in responses:

```ruby
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}"
else
  raise "unexpected: #{response}"
end
```

### NTLM Authentication

A new plugin, `:ntml_authentication`, is now available. Like the name suggests, it allows authenticating requests via [NTLM](https://docs.microsoft.com/en-us/windows-server/security/kerberos/ntlm-overview).

```ruby
ntlm_http = HTTPX.plugin(:ntlm_authentication)

ntlm.ntlm_authentication("user", "password").get("http://protected-area-requiring-ntlm.net")
# or for a specific domain
ntlm.ntlm_authentication("user", "password", "Domain\\User").get("http://protected-area-requiring-ntlm.net")
```

## 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).

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

```

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
httpx-0.15.0 doc/release_notes/0_15_0.md