httpx-patched 1.6.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.txt +191 -0
- data/README.md +162 -0
- data/doc/release_notes/0_0_1.md +7 -0
- data/doc/release_notes/0_0_2.md +9 -0
- data/doc/release_notes/0_0_3.md +9 -0
- data/doc/release_notes/0_0_4.md +7 -0
- data/doc/release_notes/0_0_5.md +5 -0
- data/doc/release_notes/0_10_0.md +66 -0
- data/doc/release_notes/0_10_1.md +37 -0
- data/doc/release_notes/0_10_2.md +5 -0
- data/doc/release_notes/0_11_0.md +74 -0
- data/doc/release_notes/0_11_1.md +5 -0
- data/doc/release_notes/0_11_2.md +5 -0
- data/doc/release_notes/0_11_3.md +5 -0
- data/doc/release_notes/0_12_0.md +55 -0
- data/doc/release_notes/0_13_0.md +58 -0
- data/doc/release_notes/0_13_1.md +5 -0
- data/doc/release_notes/0_13_2.md +9 -0
- data/doc/release_notes/0_14_0.md +79 -0
- data/doc/release_notes/0_14_1.md +7 -0
- data/doc/release_notes/0_14_2.md +6 -0
- data/doc/release_notes/0_14_3.md +5 -0
- data/doc/release_notes/0_14_4.md +5 -0
- data/doc/release_notes/0_14_5.md +11 -0
- data/doc/release_notes/0_15_0.md +53 -0
- data/doc/release_notes/0_15_1.md +8 -0
- data/doc/release_notes/0_15_2.md +9 -0
- data/doc/release_notes/0_15_3.md +5 -0
- data/doc/release_notes/0_15_4.md +5 -0
- data/doc/release_notes/0_16_0.md +93 -0
- data/doc/release_notes/0_16_1.md +5 -0
- data/doc/release_notes/0_17_0.md +49 -0
- data/doc/release_notes/0_18_0.md +69 -0
- data/doc/release_notes/0_18_1.md +12 -0
- data/doc/release_notes/0_18_2.md +10 -0
- data/doc/release_notes/0_18_3.md +7 -0
- data/doc/release_notes/0_18_4.md +14 -0
- data/doc/release_notes/0_18_5.md +10 -0
- data/doc/release_notes/0_18_6.md +5 -0
- data/doc/release_notes/0_18_7.md +5 -0
- data/doc/release_notes/0_19_0.md +39 -0
- data/doc/release_notes/0_19_1.md +5 -0
- data/doc/release_notes/0_19_2.md +7 -0
- data/doc/release_notes/0_19_3.md +6 -0
- data/doc/release_notes/0_19_4.md +14 -0
- data/doc/release_notes/0_19_5.md +13 -0
- data/doc/release_notes/0_19_6.md +5 -0
- data/doc/release_notes/0_19_7.md +5 -0
- data/doc/release_notes/0_19_8.md +5 -0
- data/doc/release_notes/0_1_0.md +9 -0
- data/doc/release_notes/0_20_0.md +36 -0
- data/doc/release_notes/0_20_1.md +5 -0
- data/doc/release_notes/0_20_2.md +7 -0
- data/doc/release_notes/0_20_3.md +6 -0
- data/doc/release_notes/0_20_4.md +17 -0
- data/doc/release_notes/0_20_5.md +3 -0
- data/doc/release_notes/0_21_0.md +96 -0
- data/doc/release_notes/0_21_1.md +12 -0
- data/doc/release_notes/0_22_0.md +13 -0
- data/doc/release_notes/0_22_1.md +11 -0
- data/doc/release_notes/0_22_2.md +5 -0
- data/doc/release_notes/0_22_3.md +55 -0
- data/doc/release_notes/0_22_4.md +6 -0
- data/doc/release_notes/0_22_5.md +6 -0
- data/doc/release_notes/0_23_0.md +42 -0
- data/doc/release_notes/0_23_1.md +5 -0
- data/doc/release_notes/0_23_2.md +5 -0
- data/doc/release_notes/0_23_3.md +6 -0
- data/doc/release_notes/0_23_4.md +5 -0
- data/doc/release_notes/0_24_0.md +48 -0
- data/doc/release_notes/0_24_1.md +12 -0
- data/doc/release_notes/0_24_2.md +12 -0
- data/doc/release_notes/0_24_3.md +12 -0
- data/doc/release_notes/0_24_4.md +18 -0
- data/doc/release_notes/0_24_5.md +6 -0
- data/doc/release_notes/0_24_6.md +5 -0
- data/doc/release_notes/0_24_7.md +10 -0
- data/doc/release_notes/0_2_0.md +5 -0
- data/doc/release_notes/0_2_1.md +16 -0
- data/doc/release_notes/0_3_0.md +12 -0
- data/doc/release_notes/0_3_1.md +6 -0
- data/doc/release_notes/0_4_0.md +51 -0
- data/doc/release_notes/0_4_1.md +3 -0
- data/doc/release_notes/0_5_0.md +15 -0
- data/doc/release_notes/0_5_1.md +14 -0
- data/doc/release_notes/0_6_0.md +5 -0
- data/doc/release_notes/0_6_1.md +6 -0
- data/doc/release_notes/0_6_2.md +6 -0
- data/doc/release_notes/0_6_3.md +13 -0
- data/doc/release_notes/0_6_4.md +21 -0
- data/doc/release_notes/0_6_5.md +22 -0
- data/doc/release_notes/0_6_6.md +19 -0
- data/doc/release_notes/0_6_7.md +5 -0
- data/doc/release_notes/0_7_0.md +46 -0
- data/doc/release_notes/0_8_0.md +27 -0
- data/doc/release_notes/0_8_1.md +8 -0
- data/doc/release_notes/0_8_2.md +7 -0
- data/doc/release_notes/0_9_0.md +38 -0
- data/doc/release_notes/1_0_0.md +60 -0
- data/doc/release_notes/1_0_1.md +5 -0
- data/doc/release_notes/1_0_2.md +7 -0
- data/doc/release_notes/1_1_0.md +32 -0
- data/doc/release_notes/1_1_1.md +17 -0
- data/doc/release_notes/1_1_2.md +12 -0
- data/doc/release_notes/1_1_3.md +18 -0
- data/doc/release_notes/1_1_4.md +6 -0
- data/doc/release_notes/1_1_5.md +12 -0
- data/doc/release_notes/1_2_0.md +49 -0
- data/doc/release_notes/1_2_1.md +6 -0
- data/doc/release_notes/1_2_2.md +10 -0
- data/doc/release_notes/1_2_3.md +16 -0
- data/doc/release_notes/1_2_4.md +8 -0
- data/doc/release_notes/1_2_5.md +7 -0
- data/doc/release_notes/1_2_6.md +13 -0
- data/doc/release_notes/1_3_0.md +18 -0
- data/doc/release_notes/1_3_1.md +17 -0
- data/doc/release_notes/1_3_2.md +6 -0
- data/doc/release_notes/1_3_3.md +5 -0
- data/doc/release_notes/1_3_4.md +6 -0
- data/doc/release_notes/1_4_0.md +43 -0
- data/doc/release_notes/1_4_1.md +19 -0
- data/doc/release_notes/1_4_2.md +20 -0
- data/doc/release_notes/1_4_3.md +11 -0
- data/doc/release_notes/1_4_4.md +14 -0
- data/doc/release_notes/1_5_0.md +126 -0
- data/doc/release_notes/1_5_1.md +6 -0
- data/doc/release_notes/1_6_0.md +50 -0
- data/doc/release_notes/1_6_1.md +17 -0
- data/doc/release_notes/1_6_2.md +11 -0
- data/lib/httpx/adapters/datadog.rb +359 -0
- data/lib/httpx/adapters/faraday.rb +303 -0
- data/lib/httpx/adapters/sentry.rb +121 -0
- data/lib/httpx/adapters/webmock.rb +175 -0
- data/lib/httpx/altsvc.rb +163 -0
- data/lib/httpx/base64.rb +27 -0
- data/lib/httpx/buffer.rb +61 -0
- data/lib/httpx/callbacks.rb +35 -0
- data/lib/httpx/chainable.rb +106 -0
- data/lib/httpx/connection/http1.rb +399 -0
- data/lib/httpx/connection/http2.rb +468 -0
- data/lib/httpx/connection.rb +954 -0
- data/lib/httpx/domain_name.rb +145 -0
- data/lib/httpx/errors.rb +111 -0
- data/lib/httpx/extensions.rb +59 -0
- data/lib/httpx/headers.rb +176 -0
- data/lib/httpx/io/ssl.rb +163 -0
- data/lib/httpx/io/tcp.rb +239 -0
- data/lib/httpx/io/udp.rb +62 -0
- data/lib/httpx/io/unix.rb +71 -0
- data/lib/httpx/io.rb +11 -0
- data/lib/httpx/loggable.rb +56 -0
- data/lib/httpx/options.rb +463 -0
- data/lib/httpx/parser/http1.rb +186 -0
- data/lib/httpx/plugins/auth/basic.rb +20 -0
- data/lib/httpx/plugins/auth/digest.rb +102 -0
- data/lib/httpx/plugins/auth/ntlm.rb +35 -0
- data/lib/httpx/plugins/auth/socks5.rb +22 -0
- data/lib/httpx/plugins/auth.rb +25 -0
- data/lib/httpx/plugins/aws_sdk_authentication.rb +111 -0
- data/lib/httpx/plugins/aws_sigv4.rb +239 -0
- data/lib/httpx/plugins/basic_auth.rb +29 -0
- data/lib/httpx/plugins/brotli.rb +50 -0
- data/lib/httpx/plugins/callbacks.rb +127 -0
- data/lib/httpx/plugins/circuit_breaker/circuit.rb +100 -0
- data/lib/httpx/plugins/circuit_breaker/circuit_store.rb +53 -0
- data/lib/httpx/plugins/circuit_breaker.rb +147 -0
- data/lib/httpx/plugins/content_digest.rb +204 -0
- data/lib/httpx/plugins/cookies/cookie.rb +174 -0
- data/lib/httpx/plugins/cookies/jar.rb +95 -0
- data/lib/httpx/plugins/cookies/set_cookie_parser.rb +143 -0
- data/lib/httpx/plugins/cookies.rb +107 -0
- data/lib/httpx/plugins/digest_auth.rb +67 -0
- data/lib/httpx/plugins/expect.rb +120 -0
- data/lib/httpx/plugins/fiber_concurrency.rb +195 -0
- data/lib/httpx/plugins/follow_redirects.rb +233 -0
- data/lib/httpx/plugins/grpc/call.rb +63 -0
- data/lib/httpx/plugins/grpc/grpc_encoding.rb +90 -0
- data/lib/httpx/plugins/grpc/message.rb +55 -0
- data/lib/httpx/plugins/grpc.rb +282 -0
- data/lib/httpx/plugins/h2c.rb +127 -0
- data/lib/httpx/plugins/internal_telemetry.rb +107 -0
- data/lib/httpx/plugins/ntlm_auth.rb +62 -0
- data/lib/httpx/plugins/oauth.rb +183 -0
- data/lib/httpx/plugins/persistent.rb +82 -0
- data/lib/httpx/plugins/proxy/http.rb +184 -0
- data/lib/httpx/plugins/proxy/socks4.rb +135 -0
- data/lib/httpx/plugins/proxy/socks5.rb +194 -0
- data/lib/httpx/plugins/proxy/ssh.rb +94 -0
- data/lib/httpx/plugins/proxy.rb +349 -0
- data/lib/httpx/plugins/push_promise.rb +81 -0
- data/lib/httpx/plugins/query.rb +35 -0
- data/lib/httpx/plugins/rate_limiter.rb +55 -0
- data/lib/httpx/plugins/response_cache/file_store.rb +140 -0
- data/lib/httpx/plugins/response_cache/store.rb +33 -0
- data/lib/httpx/plugins/response_cache.rb +333 -0
- data/lib/httpx/plugins/retries.rb +230 -0
- data/lib/httpx/plugins/ssrf_filter.rb +145 -0
- data/lib/httpx/plugins/stream.rb +183 -0
- data/lib/httpx/plugins/stream_bidi.rb +315 -0
- data/lib/httpx/plugins/upgrade/h2.rb +64 -0
- data/lib/httpx/plugins/upgrade.rb +86 -0
- data/lib/httpx/plugins/webdav.rb +86 -0
- data/lib/httpx/plugins/xml.rb +76 -0
- data/lib/httpx/pmatch_extensions.rb +33 -0
- data/lib/httpx/pool.rb +190 -0
- data/lib/httpx/punycode.rb +22 -0
- data/lib/httpx/request/body.rb +158 -0
- data/lib/httpx/request.rb +328 -0
- data/lib/httpx/resolver/entry.rb +30 -0
- data/lib/httpx/resolver/https.rb +256 -0
- data/lib/httpx/resolver/multi.rb +102 -0
- data/lib/httpx/resolver/native.rb +547 -0
- data/lib/httpx/resolver/resolver.rb +173 -0
- data/lib/httpx/resolver/system.rb +255 -0
- data/lib/httpx/resolver.rb +189 -0
- data/lib/httpx/response/body.rb +242 -0
- data/lib/httpx/response/buffer.rb +115 -0
- data/lib/httpx/response.rb +304 -0
- data/lib/httpx/selector.rb +282 -0
- data/lib/httpx/session.rb +612 -0
- data/lib/httpx/session_extensions.rb +30 -0
- data/lib/httpx/timers.rb +133 -0
- data/lib/httpx/transcoder/body.rb +43 -0
- data/lib/httpx/transcoder/chunker.rb +115 -0
- data/lib/httpx/transcoder/deflate.rb +37 -0
- data/lib/httpx/transcoder/form.rb +68 -0
- data/lib/httpx/transcoder/gzip.rb +71 -0
- data/lib/httpx/transcoder/json.rb +71 -0
- data/lib/httpx/transcoder/multipart/decoder.rb +141 -0
- data/lib/httpx/transcoder/multipart/encoder.rb +120 -0
- data/lib/httpx/transcoder/multipart/mime_type_detector.rb +78 -0
- data/lib/httpx/transcoder/multipart/part.rb +35 -0
- data/lib/httpx/transcoder/multipart.rb +31 -0
- data/lib/httpx/transcoder/utils/body_reader.rb +46 -0
- data/lib/httpx/transcoder/utils/deflater.rb +75 -0
- data/lib/httpx/transcoder.rb +91 -0
- data/lib/httpx/utils.rb +75 -0
- data/lib/httpx/version.rb +5 -0
- data/lib/httpx.rb +66 -0
- data/sig/altsvc.rbs +33 -0
- data/sig/buffer.rbs +27 -0
- data/sig/callbacks.rbs +15 -0
- data/sig/chainable.rbs +55 -0
- data/sig/connection/http1.rbs +85 -0
- data/sig/connection/http2.rbs +116 -0
- data/sig/connection.rbs +169 -0
- data/sig/domain_name.rbs +17 -0
- data/sig/errors.rbs +69 -0
- data/sig/headers.rbs +49 -0
- data/sig/httpx.rbs +27 -0
- data/sig/io/ssl.rbs +27 -0
- data/sig/io/tcp.rbs +72 -0
- data/sig/io/udp.rbs +25 -0
- data/sig/io/unix.rbs +26 -0
- data/sig/io.rbs +3 -0
- data/sig/loggable.rbs +17 -0
- data/sig/options.rbs +202 -0
- data/sig/parser/http1.rbs +59 -0
- data/sig/plugins/auth/basic.rbs +17 -0
- data/sig/plugins/auth/digest.rbs +25 -0
- data/sig/plugins/auth/ntlm.rbs +20 -0
- data/sig/plugins/auth/socks5.rbs +18 -0
- data/sig/plugins/auth.rbs +13 -0
- data/sig/plugins/aws_sdk_authentication.rbs +43 -0
- data/sig/plugins/aws_sigv4.rbs +78 -0
- data/sig/plugins/basic_auth.rbs +15 -0
- data/sig/plugins/brotli.rbs +22 -0
- data/sig/plugins/callbacks.rbs +38 -0
- data/sig/plugins/circuit_breaker.rbs +71 -0
- data/sig/plugins/compression.rbs +57 -0
- data/sig/plugins/content_digest.rbs +51 -0
- data/sig/plugins/cookies/cookie.rbs +55 -0
- data/sig/plugins/cookies/jar.rbs +26 -0
- data/sig/plugins/cookies/set_cookie_parser.rbs +22 -0
- data/sig/plugins/cookies.rbs +28 -0
- data/sig/plugins/digest_auth.rbs +21 -0
- data/sig/plugins/expect.rbs +15 -0
- data/sig/plugins/fiber_concurrency.rbs +51 -0
- data/sig/plugins/follow_redirects.rbs +47 -0
- data/sig/plugins/grpc/call.rbs +23 -0
- data/sig/plugins/grpc/grpc_encoding.rbs +37 -0
- data/sig/plugins/grpc/message.rbs +17 -0
- data/sig/plugins/grpc.rbs +65 -0
- data/sig/plugins/h2c.rbs +27 -0
- data/sig/plugins/ntlm_auth.rbs +21 -0
- data/sig/plugins/oauth.rbs +68 -0
- data/sig/plugins/persistent.rbs +14 -0
- data/sig/plugins/proxy/http.rbs +30 -0
- data/sig/plugins/proxy/socks4.rbs +37 -0
- data/sig/plugins/proxy/socks5.rbs +49 -0
- data/sig/plugins/proxy/ssh.rbs +18 -0
- data/sig/plugins/proxy.rbs +70 -0
- data/sig/plugins/push_promise.rbs +23 -0
- data/sig/plugins/query.rbs +18 -0
- data/sig/plugins/rate_limiter.rbs +13 -0
- data/sig/plugins/response_cache/file_store.rbs +19 -0
- data/sig/plugins/response_cache/store.rbs +13 -0
- data/sig/plugins/response_cache.rbs +86 -0
- data/sig/plugins/retries.rbs +66 -0
- data/sig/plugins/ssrf_filter.rbs +26 -0
- data/sig/plugins/stream.rbs +54 -0
- data/sig/plugins/stream_bidi.rbs +68 -0
- data/sig/plugins/upgrade/h2.rbs +9 -0
- data/sig/plugins/upgrade.rbs +29 -0
- data/sig/plugins/webdav.rbs +23 -0
- data/sig/plugins/xml.rbs +37 -0
- data/sig/pool.rbs +51 -0
- data/sig/punycode.rbs +5 -0
- data/sig/request/body.rbs +34 -0
- data/sig/request.rbs +88 -0
- data/sig/resolver/entry.rbs +13 -0
- data/sig/resolver/https.rbs +45 -0
- data/sig/resolver/multi.rbs +32 -0
- data/sig/resolver/native.rbs +74 -0
- data/sig/resolver/resolver.rbs +64 -0
- data/sig/resolver/system.rbs +34 -0
- data/sig/resolver.rbs +48 -0
- data/sig/response/body.rbs +52 -0
- data/sig/response/buffer.rbs +23 -0
- data/sig/response.rbs +103 -0
- data/sig/selector.rbs +68 -0
- data/sig/session.rbs +104 -0
- data/sig/timers.rbs +54 -0
- data/sig/transcoder/body.rbs +24 -0
- data/sig/transcoder/chunker.rbs +49 -0
- data/sig/transcoder/deflate.rbs +12 -0
- data/sig/transcoder/form.rbs +34 -0
- data/sig/transcoder/gzip.rbs +27 -0
- data/sig/transcoder/json.rbs +28 -0
- data/sig/transcoder/multipart.rbs +103 -0
- data/sig/transcoder/utils/body_reader.rbs +15 -0
- data/sig/transcoder/utils/deflater.rbs +28 -0
- data/sig/transcoder.rbs +43 -0
- data/sig/utils.rbs +19 -0
- metadata +518 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: b12ebe4b72a098c83f5eb1cddcf24edd91b63797a970d4d722112242c6669902
|
|
4
|
+
data.tar.gz: b1c87353a9e08a01f2793098c10d45ef3e05f016e15d3c651f521313cab838ac
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 6aaa2f726bbcf9af298d55810a732a78282b5f924800d47a097ad571ddfc8f92d8a547a79b44685e581146087ba6a22a5bfcb3348b8bbc99df20ecc838ecde99
|
|
7
|
+
data.tar.gz: b1da688c5d98274540f08e3424115dc35cb33bacd5f781a65087ae5290a824b5580da0a3676c924838996811451a70eb89b6ef3d2abdfff23ef842cc3a081208
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
https://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
Copyright 2013-2017 Docker, Inc.
|
|
180
|
+
|
|
181
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
182
|
+
you may not use this file except in compliance with the License.
|
|
183
|
+
You may obtain a copy of the License at
|
|
184
|
+
|
|
185
|
+
https://www.apache.org/licenses/LICENSE-2.0
|
|
186
|
+
|
|
187
|
+
Unless required by applicable law or agreed to in writing, software
|
|
188
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
189
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
190
|
+
See the License for the specific language governing permissions and
|
|
191
|
+
limitations under the License.
|
data/README.md
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# HTTPX: A Ruby HTTP library for tomorrow... and beyond!
|
|
2
|
+
|
|
3
|
+
[](http://rubygems.org/gems/httpx)
|
|
4
|
+
[](https://gitlab.com/os85/httpx/pipelines?page=1&scope=all&ref=master)
|
|
5
|
+
[](https://os85.gitlab.io/httpx/coverage/#_AllFiles)
|
|
6
|
+
|
|
7
|
+
HTTPX is an HTTP client library for the Ruby programming language.
|
|
8
|
+
|
|
9
|
+
Among its features, it supports:
|
|
10
|
+
|
|
11
|
+
* HTTP/2 and HTTP/1.x protocol versions
|
|
12
|
+
* Concurrent requests by default
|
|
13
|
+
* Simple and chainable API
|
|
14
|
+
* Proxy Support (HTTP(S), Socks4/4a/5)
|
|
15
|
+
* Simple Timeout System
|
|
16
|
+
* Lightweight by default (require what you need)
|
|
17
|
+
|
|
18
|
+
And also:
|
|
19
|
+
|
|
20
|
+
* Compression (gzip, deflate, brotli)
|
|
21
|
+
* Streaming Requests
|
|
22
|
+
* Auth (Basic Auth, Digest Auth, NTLM)
|
|
23
|
+
* Expect 100-continue
|
|
24
|
+
* Multipart Requests
|
|
25
|
+
* Advanced Cookie handling
|
|
26
|
+
* HTTP/2 Server Push
|
|
27
|
+
* HTTP/1.1 Upgrade (support for "h2c", "h2")
|
|
28
|
+
* Automatic follow redirects
|
|
29
|
+
* GRPC
|
|
30
|
+
* WebDAV
|
|
31
|
+
* Circuit Breaker
|
|
32
|
+
* HTTP-based response cache
|
|
33
|
+
* International Domain Names
|
|
34
|
+
|
|
35
|
+
## How
|
|
36
|
+
|
|
37
|
+
Here are some simple examples:
|
|
38
|
+
|
|
39
|
+
```ruby
|
|
40
|
+
HTTPX.get("https://nghttp2.org").to_s #=> "<!DOCT...."
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
And that's the simplest one there is. But you can also do:
|
|
44
|
+
|
|
45
|
+
```ruby
|
|
46
|
+
HTTPX.post("http://example.com", form: { user: "john", password: "pass" })
|
|
47
|
+
|
|
48
|
+
http = HTTPX.with(headers: { "x-my-name" => "joe" })
|
|
49
|
+
http.patch("http://example.com/file", body: File.open("path/to/file")) # request body is streamed
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
If you want to do some more things with the response, you can get an `HTTPX::Response`:
|
|
53
|
+
|
|
54
|
+
```ruby
|
|
55
|
+
response = HTTPX.get("https://nghttp2.org")
|
|
56
|
+
puts response.status #=> 200
|
|
57
|
+
body = response.body
|
|
58
|
+
puts body #=> #<HTTPX::Response ...
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
You can also send as many requests as you want simultaneously:
|
|
62
|
+
|
|
63
|
+
```ruby
|
|
64
|
+
page1, page2, page3 = HTTPX.get("https://news.ycombinator.com/news", "https://news.ycombinator.com/news?p=2", "https://news.ycombinator.com/news?p=3")
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Installation
|
|
68
|
+
|
|
69
|
+
Add this line to your Gemfile:
|
|
70
|
+
|
|
71
|
+
```ruby
|
|
72
|
+
gem "httpx"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
or install it in your system:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
> gem install httpx
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
and then just require it in your program:
|
|
82
|
+
|
|
83
|
+
```ruby
|
|
84
|
+
require "httpx"
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## What makes it the best ruby HTTP client
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
### Concurrency, HTTP/2 support
|
|
91
|
+
|
|
92
|
+
`httpx` supports HTTP/2 (for "https" requests, it'll automatically do ALPN negotiation). However if the server supports HTTP/1.1, it will use HTTP pipelining, falling back to 1 request at a time if the server doesn't support it either (and it'll use Keep-Alive connections, unless the server does not support).
|
|
93
|
+
|
|
94
|
+
If you passed multiple URIs, it'll perform all of the requests concurrently, by mulitplexing on the necessary sockets (and it'll batch requests to the same socket when the origin is the same):
|
|
95
|
+
|
|
96
|
+
```ruby
|
|
97
|
+
HTTPX.get(
|
|
98
|
+
"https://news.ycombinator.com/news",
|
|
99
|
+
"https://news.ycombinator.com/news?p=2",
|
|
100
|
+
"https://google.com/q=me"
|
|
101
|
+
) # first two requests will be multiplexed on the same socket.
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Clean API
|
|
105
|
+
|
|
106
|
+
`httpx` builds all functions around the `HTTPX` module, so that all calls can compose of each other. Here are a few examples:
|
|
107
|
+
|
|
108
|
+
```ruby
|
|
109
|
+
response = HTTPX.get("https://www.google.com", params: { q: "me" })
|
|
110
|
+
response = HTTPX.post("https://www.nghttp2.org/httpbin/post", form: { name: "John", age: "22" })
|
|
111
|
+
response = HTTPX.plugin(:basic_auth)
|
|
112
|
+
.basic_auth("user", "pass")
|
|
113
|
+
.get("https://www.google.com")
|
|
114
|
+
|
|
115
|
+
# more complex client objects can be cached, and are thread-safe
|
|
116
|
+
http = HTTPX.plugin(:expect).with(headers: { "x-pvt-token" => "TOKEN" })
|
|
117
|
+
http.get("https://example.com") # the above options will apply
|
|
118
|
+
http.post("https://example2.com", form: { name: "John", age: "22" }) # same, plus the form POST body
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Lightweight
|
|
122
|
+
|
|
123
|
+
It ships with most features published as a plugin, making vanilla `httpx` lightweight and dependency-free, while allowing you to "pay for what you use"
|
|
124
|
+
|
|
125
|
+
The plugin system is similar to the ones used by [sequel](https://github.com/jeremyevans/sequel), [roda](https://github.com/jeremyevans/roda) or [shrine](https://github.com/shrinerb/shrine).
|
|
126
|
+
|
|
127
|
+
### Advanced DNS features
|
|
128
|
+
|
|
129
|
+
`HTTPX` ships with custom DNS resolver implementations, including a native Happy Eyeballs resolver implementation, and a DNS-over-HTTPS resolver.
|
|
130
|
+
|
|
131
|
+
## User-driven test suite
|
|
132
|
+
|
|
133
|
+
The test suite runs against [httpbin proxied over nghttp2](https://nghttp2.org/httpbin/), so actual requests are performed during tests.
|
|
134
|
+
|
|
135
|
+
## Supported Rubies
|
|
136
|
+
|
|
137
|
+
All Rubies greater or equal to 2.7, and always latest JRuby and Truffleruby.
|
|
138
|
+
|
|
139
|
+
**Note**: This gem is tested against all latest patch versions, i.e. if you're using 3.3.0 and you experience some issue, please test it against 3.3.$latest before creating an issue.
|
|
140
|
+
|
|
141
|
+
## Resources
|
|
142
|
+
| | |
|
|
143
|
+
| ------------- | ------------------------------------------------------ |
|
|
144
|
+
| Website | https://honeyryderchuck.gitlab.io/httpx/ |
|
|
145
|
+
| Documentation | https://honeyryderchuck.gitlab.io/httpx/rdoc/ |
|
|
146
|
+
| Wiki | https://honeyryderchuck.gitlab.io/httpx/wiki/home.html |
|
|
147
|
+
| CI | https://gitlab.com/os85/httpx/pipelines |
|
|
148
|
+
| Rubygems | https://rubygems.org/gems/httpx |
|
|
149
|
+
|
|
150
|
+
## Caveats
|
|
151
|
+
|
|
152
|
+
## Versioning Policy
|
|
153
|
+
|
|
154
|
+
`httpx` follows Semantic Versioning.
|
|
155
|
+
|
|
156
|
+
## Contributing
|
|
157
|
+
|
|
158
|
+
* Discuss your contribution in an issue
|
|
159
|
+
* Fork it
|
|
160
|
+
* Make your changes, add some tests (follow the instructions from [here](test/README.md))
|
|
161
|
+
* Open a Merge Request (that's Pull Request in Github-ish)
|
|
162
|
+
* Wait for feedback
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# 0.0.2
|
|
2
|
+
|
|
3
|
+
* Hot-Fixed a flaw from the first version which was breaking https calls (SNI was broken).
|
|
4
|
+
|
|
5
|
+
* Added a few test hackernews scraping scripts, which will be used for trouble-shooting/benchmarking.
|
|
6
|
+
|
|
7
|
+
* Refactored/Fixed closing connections (HTTP/2 connections were buffering but not sending the GOAWAY frame)
|
|
8
|
+
|
|
9
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# 0.0.3
|
|
2
|
+
|
|
3
|
+
* Added `HTTPX::Response#raise_for_status`. If there was an error response, it will raise it's exception. If the HTTP response has a 4xx or 5xx error, it will raise an `HTTPX::HTTPError` exception (this feature was inspired by a similar feature in python requests library).
|
|
4
|
+
|
|
5
|
+
* Added `HTTPX::Client#wrap`, which allows to use the client inside a block and keep connections open, without resorting to the initializer only.
|
|
6
|
+
|
|
7
|
+
* TCP connection establishment errors are now wrapped in error responses, like other possible errors.
|
|
8
|
+
|
|
9
|
+
* SSL non-blocking connection API is now in use (it was previously using the blocking connect API, and was breaking the hackernews script from time to time. Now I'm looking at you, DNS).
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# 0.0.4
|
|
2
|
+
|
|
3
|
+
* Added ANSI coloring to the debugging output (when in TTY mode).
|
|
4
|
+
|
|
5
|
+
* `HTTPX::HTTPError` exceptions now carry the full response object, instead of just the status (so the user can inspect the body and headers if it so desires).
|
|
6
|
+
|
|
7
|
+
* Fixed a bug related with HTTP/1 multiple requests on a domain which closed connections not being able to open a new socket to the domain.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# 0.10.0
|
|
2
|
+
|
|
3
|
+
## Features
|
|
4
|
+
|
|
5
|
+
### Streaming Requests
|
|
6
|
+
|
|
7
|
+
The `stream` plugin adds functionality to handle long-lived stream responses, such as the Twitter Streaming API:
|
|
8
|
+
|
|
9
|
+
```ruby
|
|
10
|
+
http = HTTPX.plugin(:stream)
|
|
11
|
+
|
|
12
|
+
http.get(stream_api_endpoint, stream: true).each_line do |line|
|
|
13
|
+
payload = JSON.parse(line)
|
|
14
|
+
# do smth with this
|
|
15
|
+
end
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
https://gitlab.com/os85/httpx/-/wikis/Stream
|
|
19
|
+
|
|
20
|
+
### Rate Limiter
|
|
21
|
+
|
|
22
|
+
The `rate_limiter` plugin adds functionality for automatically hooking into rate-limiting responses coming from the server, and waits-and-retries them according to what the server advertises.
|
|
23
|
+
|
|
24
|
+
```ruby
|
|
25
|
+
HTTPX.plugin(:rate_limiter).get(rate_limited_api_endpoint)
|
|
26
|
+
# => 429 Too Many Requests .... Retry-After: 3
|
|
27
|
+
# waits 3 seconds before retrying
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
https://gitlab.com/os85/httpx/-/wikis/Rate-Limiter
|
|
31
|
+
|
|
32
|
+
### Ruby 3
|
|
33
|
+
|
|
34
|
+
This release is the first testing against and targeting Ruby 3 and some of the new features.
|
|
35
|
+
|
|
36
|
+
It ships with RBS signatures for all of the client-facing APIs. There's non 100% typinng coverage yet, but I'm gradually (pun intended) working on it.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## Improvements
|
|
40
|
+
|
|
41
|
+
### IDN support
|
|
42
|
+
|
|
43
|
+
Requests where the domains are formed by non-ASCII characters, are now supported (if you're using ruby 2.3 or more recent).
|
|
44
|
+
|
|
45
|
+
```ruby
|
|
46
|
+
HTTPX.get("http://bücher.ch") # it works!
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### cookies plugin full implementation
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
The `cookies` plugin is now independent of 3rd-party gems. The motivation for this was that `http-cookie` was dependent of both `domain_name` and `unf` gems, which are currently unusable in ruby 3, and haven't received any update in the last 3 years.
|
|
53
|
+
|
|
54
|
+
The implementation is still compliant with RFC6265, and all of the features provided in earlier versions were ported, exceptwhen loading the cookie jar stored in a Netscape-format file or Mozilla sqlite database, which were not documented for `httpx` anyway, and I considered too niche to backport. If you feel `httpx` should support those, do let me know.
|
|
55
|
+
|
|
56
|
+
Some code from these gems, including the ruby punycode implementation, is now part of the source tree, along with its licenses and attribution mentions.
|
|
57
|
+
|
|
58
|
+
## Bugfixes
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
Several edge-case bugs have been fixed solely by the integration of RBS runtime type checking, including some bugs around closing a connection pool that can cause loops.
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
## Regressions
|
|
65
|
+
|
|
66
|
+
`HTTPX::ErrorResponse`'s methods `#headers` and `#reason` were removed, as they didn't provide much value. Consider calling `#raise_for_status` or checking the API (`is_a?(HTTPX::ErrorResponse)` or `respond_to?(:error)` are strategies for this).
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# 0.10.1
|
|
2
|
+
|
|
3
|
+
## Improvements
|
|
4
|
+
|
|
5
|
+
### URL-encoded nested params
|
|
6
|
+
|
|
7
|
+
url encoder now supports nested params, which is a standard of rack-based frameworks:
|
|
8
|
+
|
|
9
|
+
```ruby
|
|
10
|
+
HTTPX.post("https://httpbin.org/post", form: { a: { b: 1 }, c: [2, 3] })
|
|
11
|
+
# a[b]=1&c[]=2&c[]=3
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
This encoding scheme is now the standard for URL-encoded request bodies, query params, and `:multipart` plugin requests.
|
|
15
|
+
|
|
16
|
+
### Socks4 IPv6 addresses
|
|
17
|
+
|
|
18
|
+
HTTPX supports IPv6 Socks4 proxies now. This support is restricted to rubies where `IPAddr#hton` is implemented though, so you are encouraged to upgrade.
|
|
19
|
+
|
|
20
|
+
## More verbose HTTP Errors
|
|
21
|
+
|
|
22
|
+
`HTTPX::Response#raise_for_status` was raising exceptions for client/server HTTP errors codes (4xx/5xx). However, only the status code was part of the message.
|
|
23
|
+
|
|
24
|
+
From now on, both headers and the responnse payload will also appear, so expected more verbosity, but also more meaningful information.
|
|
25
|
+
|
|
26
|
+
## Bugfixes
|
|
27
|
+
|
|
28
|
+
* HTTP/2 and HTTP/1.1 exhausted connections now get properly migrated into a new connection;
|
|
29
|
+
* HTTP/2 421 responses will now correctly migrate the connection and pending requests to HTTP/1.1 (a hanging loop was being caused);
|
|
30
|
+
* HTTP/2 connection failed with a GOAWAY settings timeout will now return error responses (instead of hanging indefinitely);
|
|
31
|
+
* Non-IP proxy name-resolving errors will now move on to the next available proxy in the list (instead of hanging indefinitely);
|
|
32
|
+
* Non-IP DNS resolve errors for `native` and `https` variants will now return the appropriate error response (instead of hanging indefinitely);
|
|
33
|
+
|
|
34
|
+
## Chore
|
|
35
|
+
|
|
36
|
+
* `HTTPX.plugins` is now officially deprecated (use `HTTPX.plugin` instead);
|
|
37
|
+
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# 0.11.0
|
|
2
|
+
|
|
3
|
+
## Features
|
|
4
|
+
|
|
5
|
+
### Webmock Adapter
|
|
6
|
+
|
|
7
|
+
`httpx` can now be integrated with `webmock`, a popular HTTP requests stubbing library.
|
|
8
|
+
|
|
9
|
+
```ruby
|
|
10
|
+
# minitest
|
|
11
|
+
require "webmock/minitest"
|
|
12
|
+
require "httpx/adapters/webmock"
|
|
13
|
+
|
|
14
|
+
# in rspec
|
|
15
|
+
require "webmock/rspec"
|
|
16
|
+
require "httpx/adapters/webmock"
|
|
17
|
+
|
|
18
|
+
# and now you're free for mocking
|
|
19
|
+
WebMock.enable!
|
|
20
|
+
stub_http_request(:get, "https://www.google.com").and_return(status: 200, body: "here's google")
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Read more about it in the [webmock integration documentation](https://os85.gitlab.io/httpx/wiki/Webmock-Adapter).
|
|
25
|
+
|
|
26
|
+
### Datadog Adapter
|
|
27
|
+
|
|
28
|
+
`httpx` ships with integration for [ddtrace, datadog's official tracing client](https://github.com/DataDog/dd-trace-rb). You just need to initialize it the following way:
|
|
29
|
+
|
|
30
|
+
```ruby
|
|
31
|
+
require "ddtrace"
|
|
32
|
+
require "httpx/adapters/datadog"
|
|
33
|
+
|
|
34
|
+
Datadog.configure do |c|
|
|
35
|
+
c.use :httpx
|
|
36
|
+
end
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
A trace will be emitted for every request, so this should be an interesting visualization if concurrent requests are sent.
|
|
40
|
+
|
|
41
|
+
Customization options and traces are similar to what [the net-http adapter provides](https://docs.datadoghq.com/tracing/setup_overview/setup/ruby/#nethttp).
|
|
42
|
+
|
|
43
|
+
Read more about it in the [datadog integration documentation](https://os85.gitlab.io/httpx/wiki/Datadog-Adapter).
|
|
44
|
+
|
|
45
|
+
## Improvements
|
|
46
|
+
|
|
47
|
+
### Own multipart request encoder
|
|
48
|
+
|
|
49
|
+
`httpx` now ships with its own multipart formdata encoder, and does not rely on `http-form_data` anymore:
|
|
50
|
+
|
|
51
|
+
```ruby
|
|
52
|
+
HTTPX.plugin(:multipart).post(uri, form: {file: File.new("path/to/file")})
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Read more about it in the [multipart plugin documentation](https://os85.gitlab.io/httpx/wiki/Multipart-Uploads), including also about why this was made.
|
|
56
|
+
|
|
57
|
+
### Expect Plugin
|
|
58
|
+
|
|
59
|
+
The `:expect` plugin now works reliably when the server does not support the `expect: 100-continue` header, i.e. it'll upload the body after a certain timeout. Building onn that, two behaviours are now implemented:
|
|
60
|
+
|
|
61
|
+
* A cache of domains which did not respond to the `expect` header is now kept, so that subsequent requests can skip the timeout and immediately upload the payload.
|
|
62
|
+
* If the "100 Continue" response arrives **after** the timeout expired and the body has been uploaded, the domain is removed from the cache, and subsequent requests will send the `expect` header.
|
|
63
|
+
|
|
64
|
+
### SNI/Host options
|
|
65
|
+
|
|
66
|
+
Some extension of the API was applied in order to support custom TLS negotiation parameters. You can now pass `:hostname` under the `:ssl` options, and this will be used for the SNI part of the TLS negotiation. This is useful in scenarios where a proxy certificate doesn't apply for the host one wants to send the request to:
|
|
67
|
+
|
|
68
|
+
```ruby
|
|
69
|
+
response = session.get(proxy_ip, headers: { "host" => upstream_hostname }, ssl: { hostname: sni_hostname }
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Bugfixes
|
|
73
|
+
|
|
74
|
+
A default 5 second timeout is in-place when using the DNS `:system` resolver, as it was found out that. when using the `resolv` library, the DNS query will not be retried otherwise. You can change this setting py passing `resolver_options: { timeouts: ANOTHER_TIMEOUT}`. In the future, this may become another timeout option, however.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# 0.11.3
|
|
2
|
+
|
|
3
|
+
## Bugfixes
|
|
4
|
+
|
|
5
|
+
`EOFError` was being thrown when HTTP/1.1 non-chunked responses which don't contain a "content-length" header. The RFC mandates that the socket should be consumed until the server closes it, so a patch was implemented, to return the available response in such cases.
|