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
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
module Plugins
|
|
3
|
+
module Upgrade
|
|
4
|
+
interface _Upgrader
|
|
5
|
+
def call: (Connection connection, Request request, Response response) -> void
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def self.configure: (singleton(Session)) -> void
|
|
9
|
+
|
|
10
|
+
interface _UpgradeOptions
|
|
11
|
+
def upgrade_handlers: () -> Hash[String, _Upgrader]
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def self.extra_options: (Options) -> (Options & _UpgradeOptions)
|
|
15
|
+
|
|
16
|
+
module InstanceMethods
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
module ConnectionMethods
|
|
20
|
+
attr_reader upgrade_protocol: String?
|
|
21
|
+
attr_reader hijacked: boolish
|
|
22
|
+
|
|
23
|
+
def hijack_io: () -> void
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
type sessionUpgrade = Session & Upgrade::InstanceMethods
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
module Plugins
|
|
3
|
+
module WebDav
|
|
4
|
+
module InstanceMethods
|
|
5
|
+
def copy: (String src, String dst) -> (Response | ErrorResponse)
|
|
6
|
+
|
|
7
|
+
def move: (String src, String dst) -> (Response | ErrorResponse)
|
|
8
|
+
|
|
9
|
+
def lock: (String path, ?timeout: Numeric) ?{ (Response response) -> void } -> (Response | ErrorResponse)
|
|
10
|
+
|
|
11
|
+
def unlock: (String path, String? lock_token) -> (Response | ErrorResponse)
|
|
12
|
+
|
|
13
|
+
def mkcol: (String dir) -> Response
|
|
14
|
+
|
|
15
|
+
def propfind: (String path, ?(:acl | String) xml) -> Response
|
|
16
|
+
|
|
17
|
+
def proppatch: (String path, String xml) -> Response
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
type sessionWebDav = Session & WebDav::InstanceMethods
|
|
22
|
+
end
|
|
23
|
+
end
|
data/sig/plugins/xml.rbs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
module Plugins
|
|
3
|
+
module XML
|
|
4
|
+
MIME_TYPES: Regexp
|
|
5
|
+
|
|
6
|
+
module Transcoder
|
|
7
|
+
def self?.encode: (Nokogiri::XML::Node | String xml) -> Encoder
|
|
8
|
+
def self?.decode: (HTTPX::Response response) -> HTTPX::Transcoder::_Decoder
|
|
9
|
+
|
|
10
|
+
class Encoder
|
|
11
|
+
@raw: Nokogiri::XML::Node | String # can be nokogiri object
|
|
12
|
+
|
|
13
|
+
def content_type: () -> String
|
|
14
|
+
|
|
15
|
+
def bytesize: () -> (Integer | Float)
|
|
16
|
+
|
|
17
|
+
def to_s: () -> String
|
|
18
|
+
|
|
19
|
+
private
|
|
20
|
+
|
|
21
|
+
def initialize: (Nokogiri::XML::Node | String xml) -> void
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
module InstanceMethods
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
module ResponseMethods
|
|
29
|
+
def xml: () -> Nokogiri::XML::Node
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
module RequestBodyClassMethods
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
type sessionXML = Session & XML::InstanceMethods
|
|
36
|
+
end
|
|
37
|
+
end
|
data/sig/pool.rbs
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
type pool_options = {
|
|
3
|
+
max_connections_per_origin: Integer?,
|
|
4
|
+
pool_timeout: Numeric?
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
class Pool
|
|
8
|
+
POOL_TIMEOUT: Integer
|
|
9
|
+
|
|
10
|
+
type resolver_manager = Resolver::Multi | Resolver::System
|
|
11
|
+
|
|
12
|
+
@max_connections: Integer
|
|
13
|
+
@max_connections_per_origin: Integer
|
|
14
|
+
@pool_timeout: Numeric
|
|
15
|
+
@options: Options
|
|
16
|
+
@resolvers: Hash[Class, Array[resolver_manager]]
|
|
17
|
+
@resolver_mtx: Thread::Mutex
|
|
18
|
+
@connections: Hash[String, Array[Connection]]
|
|
19
|
+
@connection_mtx: Thread::Mutex
|
|
20
|
+
@connections_counter: Integer
|
|
21
|
+
@max_connections_cond: ConditionVariable
|
|
22
|
+
@origin_counters: Hash[String, Integer]
|
|
23
|
+
@origin_conds: Hash[String, ConditionVariable]
|
|
24
|
+
|
|
25
|
+
def pop_connection: () -> Connection?
|
|
26
|
+
|
|
27
|
+
def checkout_connection: (http_uri uri, Options options) -> Connection
|
|
28
|
+
|
|
29
|
+
def checkin_connection: (Connection connection) -> void
|
|
30
|
+
|
|
31
|
+
def checkout_mergeable_connection: (Connection connection) -> Connection?
|
|
32
|
+
|
|
33
|
+
def reset_resolvers: () -> void
|
|
34
|
+
|
|
35
|
+
def checkout_resolver: (Options options) -> resolver_manager
|
|
36
|
+
|
|
37
|
+
def checkin_resolver: (Resolver::Resolver resolver) -> void
|
|
38
|
+
|
|
39
|
+
private
|
|
40
|
+
|
|
41
|
+
def initialize: (pool_options options) -> void
|
|
42
|
+
|
|
43
|
+
def acquire_connection: (http_uri uri, Options options) -> Connection?
|
|
44
|
+
|
|
45
|
+
def checkout_new_connection: (http_uri uri, Options options) -> Connection
|
|
46
|
+
|
|
47
|
+
def checkout_new_resolver: (Class resolver_type, Options options) -> resolver_manager
|
|
48
|
+
|
|
49
|
+
def drop_connection: (?Connection connection) -> Connection?
|
|
50
|
+
end
|
|
51
|
+
end
|
data/sig/punycode.rbs
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
class Request::Body
|
|
3
|
+
attr_reader options: Options
|
|
4
|
+
|
|
5
|
+
@headers: Headers
|
|
6
|
+
@body: body_encoder?
|
|
7
|
+
@unbounded_body: bool
|
|
8
|
+
|
|
9
|
+
def initialize: (Headers h, Options options, **untyped) -> void
|
|
10
|
+
|
|
11
|
+
def each: () { (String) -> void } -> void
|
|
12
|
+
| () -> Enumerable[String]
|
|
13
|
+
|
|
14
|
+
def rewind: () -> void
|
|
15
|
+
|
|
16
|
+
def empty?: () -> bool
|
|
17
|
+
|
|
18
|
+
def bytesize: () -> (Integer | Float)
|
|
19
|
+
|
|
20
|
+
def stream: (Transcoder::_Encoder) -> bodyIO
|
|
21
|
+
|
|
22
|
+
def unbounded_body?: () -> bool
|
|
23
|
+
|
|
24
|
+
def chunked?: () -> bool
|
|
25
|
+
|
|
26
|
+
def chunk!: () -> void
|
|
27
|
+
|
|
28
|
+
private
|
|
29
|
+
|
|
30
|
+
def self.initialize_body: (Hash[Symbol, untyped] params) -> body_encoder?
|
|
31
|
+
|
|
32
|
+
def self.initialize_deflater_body: (body_encoder body, Encoding | String encoding) -> body_encoder
|
|
33
|
+
end
|
|
34
|
+
end
|
data/sig/request.rbs
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
class Request
|
|
3
|
+
extend Forwardable
|
|
4
|
+
include Loggable
|
|
5
|
+
include Callbacks
|
|
6
|
+
|
|
7
|
+
METHODS: Array[Symbol]
|
|
8
|
+
USER_AGENT: String
|
|
9
|
+
|
|
10
|
+
attr_reader verb: verb
|
|
11
|
+
attr_reader uri: http_uri
|
|
12
|
+
attr_reader headers: Headers
|
|
13
|
+
attr_reader body: Body
|
|
14
|
+
attr_reader state: Symbol
|
|
15
|
+
attr_reader options: Options
|
|
16
|
+
attr_reader response: response?
|
|
17
|
+
attr_reader drain_error: StandardError?
|
|
18
|
+
attr_reader active_timeouts: Array[Symbol]
|
|
19
|
+
|
|
20
|
+
attr_accessor peer_address: (String | IPAddr)?
|
|
21
|
+
|
|
22
|
+
attr_writer persistent: bool
|
|
23
|
+
|
|
24
|
+
@ping: bool
|
|
25
|
+
@query_params: Hash[interned, untyped]?
|
|
26
|
+
@trailers: Headers?
|
|
27
|
+
@informational_status: Integer?
|
|
28
|
+
@query: String?
|
|
29
|
+
@drainer: Enumerator[String, void]?
|
|
30
|
+
|
|
31
|
+
def initialize: (Symbol | String verb, generic_uri uri, Options options, ?request_params params) -> untyped
|
|
32
|
+
|
|
33
|
+
def complete!: (?response response) -> void
|
|
34
|
+
|
|
35
|
+
def ping?: () -> bool
|
|
36
|
+
|
|
37
|
+
def ping!: () -> void
|
|
38
|
+
|
|
39
|
+
def empty?: () -> bool
|
|
40
|
+
|
|
41
|
+
def close: () -> void
|
|
42
|
+
|
|
43
|
+
def interests: () -> (:r | :w)
|
|
44
|
+
|
|
45
|
+
def can_buffer? : () -> bool
|
|
46
|
+
|
|
47
|
+
def merge_headers: (_Each[[String, headers_value]]) -> void
|
|
48
|
+
|
|
49
|
+
def scheme: () -> String
|
|
50
|
+
|
|
51
|
+
def response=: (response) -> void
|
|
52
|
+
|
|
53
|
+
def path: () -> String
|
|
54
|
+
|
|
55
|
+
def authority: () -> String
|
|
56
|
+
|
|
57
|
+
def origin: () -> String
|
|
58
|
+
|
|
59
|
+
def query: () -> String
|
|
60
|
+
|
|
61
|
+
def drain_body: () -> String?
|
|
62
|
+
|
|
63
|
+
def inspect: () -> String
|
|
64
|
+
|
|
65
|
+
def transition: (Symbol) -> void
|
|
66
|
+
|
|
67
|
+
def expects?: () -> boolish
|
|
68
|
+
|
|
69
|
+
def trailers: () -> Headers
|
|
70
|
+
|
|
71
|
+
def trailers?: () -> boolish
|
|
72
|
+
|
|
73
|
+
def persistent?: () -> bool
|
|
74
|
+
|
|
75
|
+
def read_timeout: () -> Numeric?
|
|
76
|
+
|
|
77
|
+
def write_timeout: () -> Numeric?
|
|
78
|
+
|
|
79
|
+
def request_timeout: () -> Numeric?
|
|
80
|
+
|
|
81
|
+
def set_timeout_callback: (Symbol event) { (*untyped) -> void } -> void
|
|
82
|
+
|
|
83
|
+
private
|
|
84
|
+
|
|
85
|
+
def initialize_body: (Options options) -> Transcoder::_Encoder?
|
|
86
|
+
|
|
87
|
+
end
|
|
88
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
class Resolver::Entry
|
|
3
|
+
attr_reader address: IPAddr | String
|
|
4
|
+
|
|
5
|
+
@expires_in: Numeric
|
|
6
|
+
|
|
7
|
+
def initialize: (IPAddr | _ToS address, ?Numeric expires_in, ?rescue_on_convert: boolish) -> void
|
|
8
|
+
|
|
9
|
+
def expired?: () -> bool
|
|
10
|
+
|
|
11
|
+
def self.convert: (IPAddr | _ToS address) -> Resolver::Entry
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
module Resolver
|
|
3
|
+
class HTTPS < Resolver
|
|
4
|
+
extend Forwardable
|
|
5
|
+
|
|
6
|
+
NAMESERVER: String
|
|
7
|
+
|
|
8
|
+
DEFAULTS: Hash[Symbol, untyped]
|
|
9
|
+
FAMILY_TYPES: Hash[singleton(Resolv::DNS::Resource), String]
|
|
10
|
+
|
|
11
|
+
attr_reader family: ip_family
|
|
12
|
+
|
|
13
|
+
@options: Options
|
|
14
|
+
@queries: Hash[String, Connection]
|
|
15
|
+
@requests: Hash[Request, String]
|
|
16
|
+
@connections: Array[Connection]
|
|
17
|
+
@uri: http_uri
|
|
18
|
+
@uri_addresses: Array[String]?
|
|
19
|
+
@resolver: Resolv::DNS
|
|
20
|
+
@resolver_connection: Connection
|
|
21
|
+
|
|
22
|
+
attr_writer pool: Pool
|
|
23
|
+
|
|
24
|
+
def <<: (Connection) -> void
|
|
25
|
+
|
|
26
|
+
private
|
|
27
|
+
|
|
28
|
+
def initialize: (ip_family family, options options) -> void
|
|
29
|
+
|
|
30
|
+
def resolver_connection: () -> Connection
|
|
31
|
+
|
|
32
|
+
def on_response: (Request, response) -> void
|
|
33
|
+
|
|
34
|
+
def parse: (Request request, Response response) -> void
|
|
35
|
+
|
|
36
|
+
def parse_addresses: (Array[dns_result] answers, Request request) -> void
|
|
37
|
+
|
|
38
|
+
def build_request: (String hostname) -> Request
|
|
39
|
+
|
|
40
|
+
def decode_response_body: (Response) -> dns_decoding_response
|
|
41
|
+
|
|
42
|
+
def reset_hostname: (String hostname, ?reset_candidates: bool) -> Connection?
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
module Resolver
|
|
3
|
+
class Multi
|
|
4
|
+
attr_reader resolvers: Array[Native | HTTPS]
|
|
5
|
+
|
|
6
|
+
attr_reader options: Options
|
|
7
|
+
|
|
8
|
+
@current_selector: Selector?
|
|
9
|
+
@current_session: Session?
|
|
10
|
+
@resolver_options: Hash[Symbol, untyped]
|
|
11
|
+
# @errors: Hash[Symbol, untyped]
|
|
12
|
+
|
|
13
|
+
def current_selector=: (Selector s) -> void
|
|
14
|
+
|
|
15
|
+
def current_session=: (Session s) -> void
|
|
16
|
+
|
|
17
|
+
def closed?: () -> bool
|
|
18
|
+
|
|
19
|
+
def empty?: () -> bool
|
|
20
|
+
|
|
21
|
+
def timeout: () -> Numeric?
|
|
22
|
+
|
|
23
|
+
def close: () -> void
|
|
24
|
+
|
|
25
|
+
def connections: () -> Array[Connection]
|
|
26
|
+
|
|
27
|
+
def early_resolve: (Connection connection) -> bool
|
|
28
|
+
|
|
29
|
+
def lazy_resolve: (Connection connection) -> void
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
module Resolver
|
|
3
|
+
class Native < Resolver
|
|
4
|
+
extend Forwardable
|
|
5
|
+
include _ToIO
|
|
6
|
+
|
|
7
|
+
DEFAULTS: Hash[Symbol, untyped]
|
|
8
|
+
DNS_PORT: Integer
|
|
9
|
+
|
|
10
|
+
@options: Options
|
|
11
|
+
@ns_index: Integer
|
|
12
|
+
@nameserver: Array[String]
|
|
13
|
+
@socket_type: :udp | :tcp
|
|
14
|
+
@ndots: Integer
|
|
15
|
+
@start_timeout: Float?
|
|
16
|
+
@search: Array[String]
|
|
17
|
+
@_timeouts: Array[Numeric]
|
|
18
|
+
@timeouts: Hash[String, Array[Numeric]]
|
|
19
|
+
@queries: Hash[String, Connection]
|
|
20
|
+
@connections: Array[Connection]
|
|
21
|
+
@read_buffer: String
|
|
22
|
+
@write_buffer: Buffer
|
|
23
|
+
@large_packet: Buffer?
|
|
24
|
+
@io: UDP | TCP
|
|
25
|
+
@name: String?
|
|
26
|
+
@timer: Timers::Timer?
|
|
27
|
+
|
|
28
|
+
attr_reader state: Symbol
|
|
29
|
+
|
|
30
|
+
def call: () -> void
|
|
31
|
+
|
|
32
|
+
def interests: () -> (:r | :w | nil)
|
|
33
|
+
|
|
34
|
+
def <<: (Connection) -> void
|
|
35
|
+
|
|
36
|
+
def timeout: () -> Numeric?
|
|
37
|
+
|
|
38
|
+
def handle_socket_timeout: (Numeric interval) -> void
|
|
39
|
+
|
|
40
|
+
private
|
|
41
|
+
|
|
42
|
+
def initialize: (ip_family family, options options) -> void
|
|
43
|
+
|
|
44
|
+
def calculate_interests: () -> (:r | :w | nil)
|
|
45
|
+
|
|
46
|
+
def consume: () -> void
|
|
47
|
+
|
|
48
|
+
def schedule_retry: () -> void
|
|
49
|
+
|
|
50
|
+
def do_retry: (String host, Connection connection, Numeric interval) -> void
|
|
51
|
+
|
|
52
|
+
def dread: (Integer) -> void
|
|
53
|
+
| () -> void
|
|
54
|
+
|
|
55
|
+
def dwrite: () -> void
|
|
56
|
+
|
|
57
|
+
def parse: (String) -> void
|
|
58
|
+
|
|
59
|
+
def generate_candidates: (String) -> Array[String]
|
|
60
|
+
|
|
61
|
+
def build_socket: () -> (UDP | TCP)
|
|
62
|
+
|
|
63
|
+
def downgrade_socket: () -> void
|
|
64
|
+
|
|
65
|
+
def transition: (Symbol nextstate) -> void
|
|
66
|
+
|
|
67
|
+
def handle_error: (NativeResolveError | StandardError) -> void
|
|
68
|
+
|
|
69
|
+
def reset_hostname: (String hostname, ?connection: Connection, ?reset_candidates: bool) -> void
|
|
70
|
+
|
|
71
|
+
def close_or_resolve: () -> void
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
module Resolver
|
|
3
|
+
class Resolver
|
|
4
|
+
include Callbacks
|
|
5
|
+
include Loggable
|
|
6
|
+
|
|
7
|
+
include _Selectable
|
|
8
|
+
|
|
9
|
+
RECORD_TYPES: Hash[ip_family, singleton(Resolv::DNS::Resource)]
|
|
10
|
+
|
|
11
|
+
FAMILY_TYPES: Hash[singleton(Resolv::DNS::Resource), String]
|
|
12
|
+
|
|
13
|
+
attr_reader family: ip_family
|
|
14
|
+
|
|
15
|
+
attr_reader options: Options
|
|
16
|
+
|
|
17
|
+
attr_writer current_selector: Selector?
|
|
18
|
+
|
|
19
|
+
attr_writer current_session: Session?
|
|
20
|
+
|
|
21
|
+
attr_accessor multi: Multi?
|
|
22
|
+
|
|
23
|
+
@record_type: singleton(Resolv::DNS::Resource)
|
|
24
|
+
@resolver_options: Hash[Symbol, untyped]
|
|
25
|
+
@connections: Array[Connection]
|
|
26
|
+
|
|
27
|
+
def close: () -> void
|
|
28
|
+
|
|
29
|
+
alias terminate close
|
|
30
|
+
|
|
31
|
+
def closed?: () -> bool
|
|
32
|
+
|
|
33
|
+
def empty?: () -> bool
|
|
34
|
+
|
|
35
|
+
def each_connection: () { (Connection connection) -> void } -> void
|
|
36
|
+
|
|
37
|
+
def emit_addresses: (Connection connection, ip_family family, Array[ipaddr], ?bool early_resolve) -> void
|
|
38
|
+
|
|
39
|
+
def self.multi?: () -> bool
|
|
40
|
+
|
|
41
|
+
private
|
|
42
|
+
|
|
43
|
+
def resolve: (?Connection connection, ?String hostname) -> void
|
|
44
|
+
|
|
45
|
+
def emit_resolved_connection: (Connection connection, Array[ipaddr] addresses, bool early_resolve) -> void
|
|
46
|
+
|
|
47
|
+
def initialize: (ip_family family, Options options) -> void
|
|
48
|
+
|
|
49
|
+
def early_resolve: (Connection connection, ?hostname: String) -> bool
|
|
50
|
+
|
|
51
|
+
def set_resolver_callbacks: () -> void
|
|
52
|
+
|
|
53
|
+
def resolve_connection: (Connection connection) -> void
|
|
54
|
+
|
|
55
|
+
def emit_connection_error: (Connection connection, StandardError error) -> void
|
|
56
|
+
|
|
57
|
+
def close_resolver: (Resolver resolver) -> void
|
|
58
|
+
|
|
59
|
+
def emit_resolve_error: (Connection connection, ?String hostname, ?StandardError) -> void
|
|
60
|
+
|
|
61
|
+
def resolve_error: (String hostname, ?StandardError?) -> (ResolveError | ResolveTimeoutError)
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
module Resolver
|
|
3
|
+
class System < Resolver
|
|
4
|
+
RESOLV_ERRORS: Array[singleton(StandardError)] # ResolvError
|
|
5
|
+
DONE: 1
|
|
6
|
+
ERROR: 2
|
|
7
|
+
|
|
8
|
+
@resolver: Resolv::DNS
|
|
9
|
+
@_timeouts: Array[Numeric]
|
|
10
|
+
@timeouts: Hash[String, Array[Numeric]]
|
|
11
|
+
@queries: Array[[ip_family, Connection]]
|
|
12
|
+
@ips: Array[[ip_family, Connection, (Array[Addrinfo] | StandardError)]]
|
|
13
|
+
@pipe_mutex: Thread::Mutex
|
|
14
|
+
@pipe_read: IO
|
|
15
|
+
@pipe_write: IO
|
|
16
|
+
|
|
17
|
+
attr_reader state: Symbol
|
|
18
|
+
|
|
19
|
+
def <<: (Connection) -> void
|
|
20
|
+
|
|
21
|
+
private
|
|
22
|
+
|
|
23
|
+
def transition: (Symbol nextstate) -> void
|
|
24
|
+
|
|
25
|
+
def consume: () -> void
|
|
26
|
+
|
|
27
|
+
def async_resolve: (Connection connection, String hostname, String scheme) -> void
|
|
28
|
+
|
|
29
|
+
def __addrinfo_resolve: (String host, String scheme) -> Array[Addrinfo]
|
|
30
|
+
|
|
31
|
+
def initialize: (Options options) -> void
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
data/sig/resolver.rbs
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
type ipaddr = String | IPAddr | Resolv::IPv4 | Resolver::Entry
|
|
3
|
+
|
|
4
|
+
module Resolver
|
|
5
|
+
type dns_resource = singleton(Resolv::DNS::Resource)
|
|
6
|
+
|
|
7
|
+
type dns_result = { "name" => String, "TTL" => Numeric, "alias" => String }
|
|
8
|
+
| { "name" => String, "TTL" => Numeric, "data" => String }
|
|
9
|
+
|
|
10
|
+
RESOLVE_TIMEOUT: Array[Integer]
|
|
11
|
+
|
|
12
|
+
self.@lookup_mutex: Thread::Mutex
|
|
13
|
+
self.@lookups: Hash[String, Array[dns_result]]
|
|
14
|
+
self.@identifier_mutex: Thread::Mutex
|
|
15
|
+
self.@identifier: Integer
|
|
16
|
+
self.@hosts_resolver: Resolv::Hosts
|
|
17
|
+
|
|
18
|
+
type dns_decoding_response = [:ok, Array[dns_result]] | [:decode_error, Resolv::DNS::DecodeError] | [:dns_error, Integer] | Symbol
|
|
19
|
+
|
|
20
|
+
def self?.nolookup_resolve: (String hostname) -> Array[Entry]?
|
|
21
|
+
|
|
22
|
+
def self?.ip_resolve: (String hostname) -> Array[Entry]?
|
|
23
|
+
|
|
24
|
+
def self?.hosts_resolve: (String hostname) -> Array[Entry]?
|
|
25
|
+
|
|
26
|
+
def self?.supported_ip_families: () -> Array[ip_family]
|
|
27
|
+
|
|
28
|
+
def self?.resolver_for: (Symbol | singleton(Resolver) resolver_type, Options options) -> singleton(Resolver)
|
|
29
|
+
|
|
30
|
+
def self?.cached_lookup: (String hostname) -> Array[Entry]?
|
|
31
|
+
|
|
32
|
+
def self?.cached_lookup_set: (String hostname, ip_family family, Array[dns_result] addresses) -> void
|
|
33
|
+
|
|
34
|
+
def self?.cached_lookup_evict: (String hostname, _ToS ip) -> void
|
|
35
|
+
|
|
36
|
+
def self?.lookup: (String hostname, Hash[String, Array[dns_result]] lookups, Numeric ttl) -> Array[Entry]?
|
|
37
|
+
|
|
38
|
+
def self?.generate_id: () -> Integer
|
|
39
|
+
|
|
40
|
+
def self?.encode_dns_query: (String hostname, ?type: dns_resource, ?message_id: Integer) -> String
|
|
41
|
+
|
|
42
|
+
def self?.decode_dns_answer: (String) -> dns_decoding_response
|
|
43
|
+
|
|
44
|
+
def self?.lookup_synchronize: [U] () { (Hash[String, Array[dns_result]] lookups) -> U } -> U
|
|
45
|
+
|
|
46
|
+
def self?.id_synchronize: () { () -> void } -> void
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
class Response::Body
|
|
3
|
+
include _Reader
|
|
4
|
+
include _ToS
|
|
5
|
+
include _ToStr
|
|
6
|
+
|
|
7
|
+
attr_reader encoding: Encoding
|
|
8
|
+
attr_reader encodings: Array[String]
|
|
9
|
+
|
|
10
|
+
attr_reader buffer: Response::Buffer?
|
|
11
|
+
|
|
12
|
+
@response: Response
|
|
13
|
+
@headers: Headers
|
|
14
|
+
@options: Options
|
|
15
|
+
@state: :idle | :memory | :buffer | :closed
|
|
16
|
+
@window_size: Integer
|
|
17
|
+
@length: Integer
|
|
18
|
+
@reader: Response::Buffer?
|
|
19
|
+
@inflaters: Array[Transcoder::_Inflater]
|
|
20
|
+
|
|
21
|
+
def initialize: (Response, Options) -> void
|
|
22
|
+
|
|
23
|
+
def closed?: () -> bool
|
|
24
|
+
|
|
25
|
+
def write:(String chunk) -> Integer?
|
|
26
|
+
|
|
27
|
+
def filename: () -> String?
|
|
28
|
+
|
|
29
|
+
def bytesize: () -> Integer
|
|
30
|
+
|
|
31
|
+
def each: () { (String) -> void } -> void
|
|
32
|
+
| () -> Enumerable[String]
|
|
33
|
+
|
|
34
|
+
def empty?: () -> bool
|
|
35
|
+
|
|
36
|
+
def copy_to: (String | File | _Writer destination) -> void
|
|
37
|
+
|
|
38
|
+
def close: () -> void
|
|
39
|
+
|
|
40
|
+
def rewind: () -> void
|
|
41
|
+
|
|
42
|
+
private
|
|
43
|
+
|
|
44
|
+
def initialize_inflaters: () -> void
|
|
45
|
+
|
|
46
|
+
def self.initialize_inflater_by_encoding: (Encoding | String encoding, Response response, ?bytesize: Integer) -> Transcoder::GZIP::Inflater
|
|
47
|
+
|
|
48
|
+
def decode_chunk: (String chunk) -> String
|
|
49
|
+
|
|
50
|
+
def transition: (Symbol nextstate) -> void
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
class Response::Buffer
|
|
3
|
+
attr_reader buffer: StringIO | Tempfile
|
|
4
|
+
|
|
5
|
+
@threshold_size: Integer
|
|
6
|
+
@bytesize: Integer
|
|
7
|
+
@encoding: Encoding
|
|
8
|
+
|
|
9
|
+
def initialize: (threshold_size: Integer, ?bytesize: Integer, ?encoding: Encoding) -> void
|
|
10
|
+
|
|
11
|
+
def size: () -> Integer
|
|
12
|
+
|
|
13
|
+
def write: (String chunk) -> Integer
|
|
14
|
+
|
|
15
|
+
def to_s: () -> String
|
|
16
|
+
|
|
17
|
+
def close: () -> void
|
|
18
|
+
|
|
19
|
+
private
|
|
20
|
+
|
|
21
|
+
def try_upgrade_buffer: () -> void
|
|
22
|
+
end
|
|
23
|
+
end
|