Sha256: 670630e9e4c35622c994199b279af65faf6f4eed7cd8055e10380f3e07e21d5e
Contents?: true
Size: 1.63 KB
Versions: 71
Compression:
Stored size: 1.63 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}).... ``` IDNA 2008 support is now possibly, by integrating [idnx](https://github.com/HoneyryderChuck/idnx) into your dependencies: ```ruby # in Gemfile gem "httpx" gem "idnx" ```
Version data entries
71 entries across 71 versions & 1 rubygems