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
data/sig/response.rbs
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
interface _Response
|
|
3
|
+
def <<: (String data) -> void
|
|
4
|
+
|
|
5
|
+
def finished?: () -> bool
|
|
6
|
+
|
|
7
|
+
def finish!: () -> void
|
|
8
|
+
|
|
9
|
+
def raise_for_status: () -> self
|
|
10
|
+
|
|
11
|
+
def error: () -> StandardError?
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
class Response
|
|
15
|
+
extend Forwardable
|
|
16
|
+
include Callbacks
|
|
17
|
+
|
|
18
|
+
include _Response
|
|
19
|
+
include _ToS
|
|
20
|
+
include _Reader
|
|
21
|
+
|
|
22
|
+
attr_reader status: Integer
|
|
23
|
+
attr_reader headers: Headers
|
|
24
|
+
attr_reader body: Body
|
|
25
|
+
attr_reader version: String
|
|
26
|
+
|
|
27
|
+
@options: Options
|
|
28
|
+
@request: Request
|
|
29
|
+
@content_type: ContentType
|
|
30
|
+
@finished: bool
|
|
31
|
+
|
|
32
|
+
def copy_to: (_ToPath | _Writer destination) -> void
|
|
33
|
+
|
|
34
|
+
def close: () -> void
|
|
35
|
+
|
|
36
|
+
def uri: () -> URI::Generic
|
|
37
|
+
|
|
38
|
+
def peer_address: () -> (String | IPAddr)?
|
|
39
|
+
|
|
40
|
+
def merge_headers: (_Each[[String, headers_value]]) -> void
|
|
41
|
+
|
|
42
|
+
def bodyless?: () -> bool
|
|
43
|
+
|
|
44
|
+
def content_type: () -> ContentType
|
|
45
|
+
|
|
46
|
+
def complete?: () -> bool
|
|
47
|
+
|
|
48
|
+
def json: (?JSON::options opts) -> untyped
|
|
49
|
+
|
|
50
|
+
def form: () -> Hash[String, untyped]
|
|
51
|
+
|
|
52
|
+
def initialize: (Request request, String | Integer status, String version, headers?) -> void
|
|
53
|
+
|
|
54
|
+
private
|
|
55
|
+
|
|
56
|
+
def decode:(Transcoder::_Decode transcoder, ?untyped options) -> untyped
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
class ContentType
|
|
60
|
+
MIME_TYPE_RE: Regexp
|
|
61
|
+
CHARSET_RE: Regexp
|
|
62
|
+
|
|
63
|
+
@header_value: String?
|
|
64
|
+
@mime_type: String?
|
|
65
|
+
@charset: String?
|
|
66
|
+
|
|
67
|
+
def mime_type: () -> String?
|
|
68
|
+
|
|
69
|
+
def charset: () -> String?
|
|
70
|
+
|
|
71
|
+
private
|
|
72
|
+
|
|
73
|
+
def initialize: (String? header_value) -> void
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
class ErrorResponse
|
|
77
|
+
include _Response
|
|
78
|
+
include _Reader
|
|
79
|
+
include Loggable
|
|
80
|
+
extend Forwardable
|
|
81
|
+
|
|
82
|
+
@options: Options
|
|
83
|
+
@error: Exception
|
|
84
|
+
|
|
85
|
+
%a{pure} attr_reader request: Request
|
|
86
|
+
|
|
87
|
+
%a{pure} attr_reader response: Response?
|
|
88
|
+
|
|
89
|
+
def status: () -> (Integer | _ToS)
|
|
90
|
+
|
|
91
|
+
def uri: () -> URI::Generic
|
|
92
|
+
|
|
93
|
+
def peer_address: () -> (String | IPAddr)?
|
|
94
|
+
|
|
95
|
+
def close: () -> void
|
|
96
|
+
|
|
97
|
+
private
|
|
98
|
+
|
|
99
|
+
def initialize: (Request, Exception) -> untyped
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
type response = Response | ErrorResponse
|
|
103
|
+
end
|
data/sig/selector.rbs
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
interface _Selectable
|
|
3
|
+
def state: () -> Symbol
|
|
4
|
+
|
|
5
|
+
def to_io: () -> IO
|
|
6
|
+
|
|
7
|
+
def call: () -> void
|
|
8
|
+
|
|
9
|
+
def interests: () -> io_interests?
|
|
10
|
+
|
|
11
|
+
def timeout: () -> Numeric?
|
|
12
|
+
|
|
13
|
+
def handle_socket_timeout: (Numeric interval) -> void
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
class Selector
|
|
17
|
+
type selectable = Resolver::Resolver | Connection | (Object & _Selectable)
|
|
18
|
+
|
|
19
|
+
type io_select_selectable = (selectable | Array[selectable])?
|
|
20
|
+
|
|
21
|
+
include _Each[selectable]
|
|
22
|
+
|
|
23
|
+
extend Forwardable
|
|
24
|
+
|
|
25
|
+
READABLE: Array[io_interests]
|
|
26
|
+
WRITABLE: Array[io_interests]
|
|
27
|
+
|
|
28
|
+
@timers: Timers
|
|
29
|
+
|
|
30
|
+
@selectables: Array[selectable]
|
|
31
|
+
@is_timer_interval: bool
|
|
32
|
+
|
|
33
|
+
def next_tick: () -> void
|
|
34
|
+
|
|
35
|
+
def terminate: () -> void
|
|
36
|
+
|
|
37
|
+
def find_resolver: (Options options) -> Resolver::Resolver?
|
|
38
|
+
|
|
39
|
+
def find_connection: (http_uri request_uri, Options options) -> Connection?
|
|
40
|
+
|
|
41
|
+
def each_connection: () { (Connection) -> void} -> void
|
|
42
|
+
| () -> Enumerable[Connection]
|
|
43
|
+
|
|
44
|
+
def find_mergeable_connection: (Connection connection) -> Connection?
|
|
45
|
+
|
|
46
|
+
def empty?: () -> bool
|
|
47
|
+
|
|
48
|
+
def register: (selectable io) -> void
|
|
49
|
+
|
|
50
|
+
def deregister: (selectable io) -> selectable?
|
|
51
|
+
|
|
52
|
+
private
|
|
53
|
+
|
|
54
|
+
def initialize: () -> void
|
|
55
|
+
|
|
56
|
+
def select: (Numeric? interval) { (selectable) -> void } -> void
|
|
57
|
+
|
|
58
|
+
def select_many: (io_select_selectable r, io_select_selectable w, Numeric? interval) { (selectable) -> void } -> void
|
|
59
|
+
|
|
60
|
+
def select_one: (selectable io, io_interests interests, Numeric? interval) { (selectable) -> void } -> void
|
|
61
|
+
|
|
62
|
+
def next_timeout: () -> Numeric?
|
|
63
|
+
|
|
64
|
+
def rw_wait: (io_select_selectable IO, Numeric? interval) -> untyped?
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
type io_interests = :r | :w | :rw
|
|
68
|
+
end
|
data/sig/session.rbs
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
class Session
|
|
3
|
+
include Loggable
|
|
4
|
+
include Chainable
|
|
5
|
+
|
|
6
|
+
EMPTY_HASH: Hash[untyped, untyped]
|
|
7
|
+
|
|
8
|
+
@options: Options
|
|
9
|
+
|
|
10
|
+
# returns the HTTPX::Pool object which manages the networking required to
|
|
11
|
+
# perform requests.
|
|
12
|
+
@pool: Pool
|
|
13
|
+
|
|
14
|
+
@persistent: bool
|
|
15
|
+
@wrapped: bool
|
|
16
|
+
@closing: bool
|
|
17
|
+
|
|
18
|
+
def wrap: () { (instance) -> void } -> void
|
|
19
|
+
|
|
20
|
+
def close: (?Selector selector) -> void
|
|
21
|
+
|
|
22
|
+
def build_request: (verb verb, generic_uri uri, ?request_params params, ?Options options) -> Request
|
|
23
|
+
|
|
24
|
+
def select_connection: (Connection connection, Selector selector) -> void
|
|
25
|
+
|
|
26
|
+
def pin_connection: (Resolver::Resolver | Connection connection, Selector selector) -> void
|
|
27
|
+
|
|
28
|
+
def deselect_connection: (Connection connection, Selector selector, ?bool cloned) -> void
|
|
29
|
+
|
|
30
|
+
def select_resolver: (Resolver::Native | Resolver::HTTPS resolver, Selector selector) -> void
|
|
31
|
+
|
|
32
|
+
def deselect_resolver: (Resolver::Resolver resolver, Selector selector) -> void
|
|
33
|
+
|
|
34
|
+
def try_clone_connection: (Connection connection, Selector selector, Integer? family) -> Connection
|
|
35
|
+
|
|
36
|
+
def find_connection: (http_uri request_uri, Selector selector, Options options) -> Connection
|
|
37
|
+
|
|
38
|
+
private
|
|
39
|
+
|
|
40
|
+
def initialize: (?options) { (self) -> void } -> void
|
|
41
|
+
| (?options) -> void
|
|
42
|
+
|
|
43
|
+
def selector_close: (Selector close) -> void
|
|
44
|
+
|
|
45
|
+
def deactivate: (Selector selector) -> void
|
|
46
|
+
|
|
47
|
+
def on_promise: (untyped, untyped) -> void
|
|
48
|
+
|
|
49
|
+
def fetch_response: (Request request, Selector selector, Options options) -> response?
|
|
50
|
+
|
|
51
|
+
def send_request: (Request request, Selector selector, ?Options options) -> void
|
|
52
|
+
|
|
53
|
+
def set_request_callbacks: (Request request) -> void
|
|
54
|
+
|
|
55
|
+
def build_requests: (verb, uri, request_params) -> Array[Request]
|
|
56
|
+
| (Array[[verb, uri, request_params]], Hash[Symbol, untyped]) -> Array[Request]
|
|
57
|
+
| (Array[[verb, uri]], request_params) -> Array[Request]
|
|
58
|
+
| (verb, _Each[[uri, request_params]], Hash[Symbol, untyped]) -> Array[Request]
|
|
59
|
+
| (verb, _Each[uri], request_params) -> Array[Request]
|
|
60
|
+
|
|
61
|
+
def do_init_connection: (Connection connection, Selector selector) -> void
|
|
62
|
+
|
|
63
|
+
def send_requests: (*Request) -> Array[response]
|
|
64
|
+
|
|
65
|
+
def _send_requests: (Array[Request] requests, Selector selector) -> void
|
|
66
|
+
|
|
67
|
+
def receive_requests: (Array[Request] requests, Selector selector) -> Array[response]
|
|
68
|
+
|
|
69
|
+
def resolve_connection: (Connection connection, Selector selector) -> void
|
|
70
|
+
|
|
71
|
+
def on_resolver_connection: (Connection connection, Selector selector) -> void
|
|
72
|
+
|
|
73
|
+
def on_resolver_close: (Resolver::Resolver resolver, Selector selector) -> void
|
|
74
|
+
|
|
75
|
+
def find_resolver_for: (Connection connection, Selector selector) -> (Resolver::Multi | Resolver::Resolver)
|
|
76
|
+
|
|
77
|
+
def coalesce_connections: (Connection conn1, Connection conn2, Selector selector, bool from_pool) -> bool
|
|
78
|
+
|
|
79
|
+
def get_current_selector: () -> Selector?
|
|
80
|
+
| () { () -> Selector } -> Selector
|
|
81
|
+
|
|
82
|
+
def set_current_selector: (Selector? selector) -> void
|
|
83
|
+
|
|
84
|
+
def selector_store: () -> Hash[instance, Selector]
|
|
85
|
+
|
|
86
|
+
def thread_selector_store: (Thread th) -> Hash[instance, Selector]?
|
|
87
|
+
|
|
88
|
+
attr_reader self.default_options: Options
|
|
89
|
+
self.@plugins: Array[Module]
|
|
90
|
+
|
|
91
|
+
def self.plugin: (Symbol | Module plugin, ?options? options) ?{ (Class) -> void } -> singleton(Session)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
INSTANCES: Hash[Session, Session]
|
|
95
|
+
|
|
96
|
+
def self.after_fork: () -> void
|
|
97
|
+
|
|
98
|
+
module ForkTracker
|
|
99
|
+
def _fork: () -> void
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
S: singleton(Session)
|
|
104
|
+
end
|
data/sig/timers.rbs
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
class Timers
|
|
3
|
+
type callback = ^() -> void
|
|
4
|
+
|
|
5
|
+
@intervals: Array[Interval]
|
|
6
|
+
@next_interval_at: Float
|
|
7
|
+
|
|
8
|
+
def after: (Numeric interval_in_secs, ^() -> void) -> Timer
|
|
9
|
+
| (Numeric interval_in_secs) { () -> void } -> Timer
|
|
10
|
+
|
|
11
|
+
def wait_interval: () -> Numeric?
|
|
12
|
+
|
|
13
|
+
def fire: (?TimeoutError error) -> void
|
|
14
|
+
|
|
15
|
+
def initialize: () -> void
|
|
16
|
+
|
|
17
|
+
private
|
|
18
|
+
|
|
19
|
+
def drop_elapsed!: (?Numeric elapsed_time) -> void
|
|
20
|
+
|
|
21
|
+
class Interval
|
|
22
|
+
include Comparable
|
|
23
|
+
|
|
24
|
+
attr_reader interval: Numeric
|
|
25
|
+
|
|
26
|
+
@callbacks: Array[callback]
|
|
27
|
+
|
|
28
|
+
def to_f: () -> Float
|
|
29
|
+
|
|
30
|
+
def <<: (callback) -> void
|
|
31
|
+
|
|
32
|
+
def delete: (callback) -> void
|
|
33
|
+
|
|
34
|
+
def elapse: (Numeric elapsed) -> Numeric
|
|
35
|
+
|
|
36
|
+
def elapsed?: (?Numeric elapsed_time) -> bool
|
|
37
|
+
|
|
38
|
+
def no_callbacks?: () -> bool
|
|
39
|
+
|
|
40
|
+
private
|
|
41
|
+
|
|
42
|
+
def initialize: (Numeric interval) -> void
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
class Timer
|
|
46
|
+
@interval: Interval
|
|
47
|
+
@callback: callback
|
|
48
|
+
|
|
49
|
+
def initialize: (Interval interval, callback callback) -> void
|
|
50
|
+
|
|
51
|
+
def cancel: () -> void
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
module Transcoder
|
|
3
|
+
module Body
|
|
4
|
+
class Error < HTTPX::Error
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
class Encoder # < SimpleDelegator
|
|
8
|
+
@raw: Object & bodyIO
|
|
9
|
+
|
|
10
|
+
def bytesize: () -> (Integer | Float)
|
|
11
|
+
|
|
12
|
+
def content_type: () -> String
|
|
13
|
+
|
|
14
|
+
def to_s: () -> String
|
|
15
|
+
|
|
16
|
+
private
|
|
17
|
+
|
|
18
|
+
def initialize: (untyped body) -> untyped
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def self?.encode: (bodyIO body) -> Encoder
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
module HTTPX::Transcoder
|
|
2
|
+
module Chunker
|
|
3
|
+
CRLF: String
|
|
4
|
+
|
|
5
|
+
class Error < HTTPX::Error
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def self?.encode: (_Each[String] chunks) -> Encoder
|
|
9
|
+
|
|
10
|
+
class Encoder
|
|
11
|
+
@raw: Object & _Each[String]
|
|
12
|
+
|
|
13
|
+
def each: () { (String) -> void } -> void
|
|
14
|
+
| () -> Enumerator[String, void]
|
|
15
|
+
|
|
16
|
+
private
|
|
17
|
+
|
|
18
|
+
def initialize: (_Each[String] chunks) -> void
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
class Decoder
|
|
22
|
+
extend Forwardable
|
|
23
|
+
include _ToS
|
|
24
|
+
|
|
25
|
+
@buffer: String
|
|
26
|
+
@chunk_length: Integer
|
|
27
|
+
@chunk_buffer: String
|
|
28
|
+
@finished: bool
|
|
29
|
+
@state: Symbol
|
|
30
|
+
@trailers: bool
|
|
31
|
+
|
|
32
|
+
def each: () { (String) -> void } -> void
|
|
33
|
+
|
|
34
|
+
def finished?: () -> bool
|
|
35
|
+
|
|
36
|
+
def empty?: () -> bool
|
|
37
|
+
|
|
38
|
+
def <<: (string) -> void
|
|
39
|
+
|
|
40
|
+
def clear: () -> void
|
|
41
|
+
|
|
42
|
+
private
|
|
43
|
+
|
|
44
|
+
def initialize: (String, ?bool) -> void
|
|
45
|
+
|
|
46
|
+
def nextstate: (Symbol) -> void
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
module Transcoder
|
|
3
|
+
module Deflate
|
|
4
|
+
def self?.encode: (_Encoder body) -> Deflater
|
|
5
|
+
def self?.decode: (Response body, ?bytesize: Integer) -> GZIP::Inflater
|
|
6
|
+
|
|
7
|
+
class Deflater < Transcoder::Deflater
|
|
8
|
+
@deflater: Zlib::Deflate
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
module HTTPX::Transcoder
|
|
2
|
+
type form_value = string
|
|
3
|
+
|
|
4
|
+
type form_nested_value = form_value | _ToAry[form_value] | _ToHash[string, form_value]
|
|
5
|
+
|
|
6
|
+
type urlencoded_input = Enumerable[[_ToS, form_nested_value]]
|
|
7
|
+
|
|
8
|
+
module Form
|
|
9
|
+
PARAM_DEPTH_LIMIT: Integer
|
|
10
|
+
|
|
11
|
+
def self?.encode: (urlencoded_input form) -> Encoder
|
|
12
|
+
|
|
13
|
+
def self?.decode: (HTTPX::Response response) -> _Decoder
|
|
14
|
+
|
|
15
|
+
class Encoder
|
|
16
|
+
extend Forwardable
|
|
17
|
+
include _ToS
|
|
18
|
+
|
|
19
|
+
@raw: String
|
|
20
|
+
|
|
21
|
+
def bytesize: () -> Integer
|
|
22
|
+
|
|
23
|
+
def content_type: () -> String
|
|
24
|
+
|
|
25
|
+
private
|
|
26
|
+
|
|
27
|
+
def initialize: (urlencoded_input form) -> untyped
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
module Decoder
|
|
31
|
+
def self?.call: (HTTPX::Response response, *untyped) -> Hash[String, untyped]
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
module Transcoder
|
|
3
|
+
module GZIP
|
|
4
|
+
def self?.encode: (body_encoder body) -> Deflater
|
|
5
|
+
def self?.decode: (Response response, ?bytesize: Integer) -> Inflater
|
|
6
|
+
|
|
7
|
+
class Deflater < Transcoder::Deflater
|
|
8
|
+
@compressed_chunk: String
|
|
9
|
+
|
|
10
|
+
private
|
|
11
|
+
|
|
12
|
+
def write: (String chunk) -> void
|
|
13
|
+
|
|
14
|
+
def compressed_chunk: () -> String
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
class Inflater
|
|
18
|
+
@inflater: Zlib::Inflate
|
|
19
|
+
@bytesize: Integer
|
|
20
|
+
|
|
21
|
+
def initialize: (Integer | Float bytesize) -> void
|
|
22
|
+
|
|
23
|
+
def call: (String chunk) -> String
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module HTTPX::Transcoder
|
|
2
|
+
module JSON
|
|
3
|
+
JSON_REGEX: Regexp
|
|
4
|
+
|
|
5
|
+
def self?.encode: (_ToJson json) -> Encoder
|
|
6
|
+
def self?.decode: (HTTPX::Response response) -> _Decoder
|
|
7
|
+
|
|
8
|
+
def self?.json_load: (string source, ?JSON::options) -> untyped
|
|
9
|
+
def self?.json_dump: (_ToJson obj, *untyped) -> String
|
|
10
|
+
|
|
11
|
+
class Encoder
|
|
12
|
+
extend Forwardable
|
|
13
|
+
|
|
14
|
+
@raw: String
|
|
15
|
+
@charset: String
|
|
16
|
+
|
|
17
|
+
def bytesize: () -> Integer
|
|
18
|
+
|
|
19
|
+
def content_type: () -> String
|
|
20
|
+
|
|
21
|
+
def to_s: () -> String
|
|
22
|
+
|
|
23
|
+
private
|
|
24
|
+
|
|
25
|
+
def initialize: (_ToJson json) -> void
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
module Transcoder
|
|
3
|
+
module Multipart
|
|
4
|
+
interface _MultipartInput
|
|
5
|
+
def filename: () -> String
|
|
6
|
+
def content_type: () -> String
|
|
7
|
+
def read: (?int? length, ?string? output) -> String?
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
MULTIPART_VALUE_COND: ^(_Reader | record_multipart_value value) -> bool
|
|
11
|
+
|
|
12
|
+
type multipart_value = string | Pathname | File | Tempfile | _Reader
|
|
13
|
+
|
|
14
|
+
type record_multipart_value = { content_type: String, filename: String, body: multipart_value } |
|
|
15
|
+
{ content_type: String, body: multipart_value }
|
|
16
|
+
|
|
17
|
+
type multipart_nested_value = multipart_value | _ToAry[multipart_value] | _ToHash[string, multipart_value]
|
|
18
|
+
|
|
19
|
+
type multipart_input = Enumerable[[_ToS, Multipart::multipart_nested_value]]
|
|
20
|
+
|
|
21
|
+
def self?.encode: (multipart_input form_data) -> Multipart::Encoder
|
|
22
|
+
|
|
23
|
+
def self?.multipart?: (form_nested_value | multipart_nested_value form_data) -> bool
|
|
24
|
+
|
|
25
|
+
class Encoder
|
|
26
|
+
@boundary: String
|
|
27
|
+
@part_index: Integer
|
|
28
|
+
@buffer: String
|
|
29
|
+
|
|
30
|
+
@form: Enumerable[[Symbol | string, Object & multipart_nested_value]]
|
|
31
|
+
@parts: Array[Object & _Reader]
|
|
32
|
+
|
|
33
|
+
attr_reader bytesize: Integer
|
|
34
|
+
|
|
35
|
+
def content_type: () -> String
|
|
36
|
+
|
|
37
|
+
def to_s: () -> String
|
|
38
|
+
|
|
39
|
+
def read: (?int? length, ?string? buffer) -> String?
|
|
40
|
+
|
|
41
|
+
def rewind: () -> void
|
|
42
|
+
|
|
43
|
+
private
|
|
44
|
+
|
|
45
|
+
def to_parts: (multipart_input multipart_data) -> Array[_Reader]
|
|
46
|
+
|
|
47
|
+
def initialize: (multipart_input multipart_data) -> untyped
|
|
48
|
+
|
|
49
|
+
def header_part: (String key, String content_type, String? filename) -> StringIO
|
|
50
|
+
|
|
51
|
+
def read_chunks: (String buffer, ?Integer? length) -> void
|
|
52
|
+
|
|
53
|
+
def read_from_part: (?Integer? max_length) -> String?
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
class Decoder
|
|
57
|
+
CRLF: String
|
|
58
|
+
BOUNDARY_RE: Regexp
|
|
59
|
+
MULTIPART_CONTENT_TYPE: Regexp
|
|
60
|
+
MULTIPART_CONTENT_DISPOSITION: Regexp
|
|
61
|
+
MULTIPART_CONTENT_ID: Regexp
|
|
62
|
+
WINDOW_SIZE: Integer
|
|
63
|
+
|
|
64
|
+
@state: :idle | :part_header | :part_body | :parse_boundary | :done
|
|
65
|
+
@buffer: String
|
|
66
|
+
@parts: Hash[String, untyped]
|
|
67
|
+
@boundary: String
|
|
68
|
+
@intermediate_boundary: String
|
|
69
|
+
@current: String?
|
|
70
|
+
|
|
71
|
+
def call: (Response response, *untyped) -> Hash[String, untyped]
|
|
72
|
+
|
|
73
|
+
private
|
|
74
|
+
|
|
75
|
+
def initialize: (Response response) -> void
|
|
76
|
+
|
|
77
|
+
def parse: () -> void
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
class FilePart # < SimpleDelegator
|
|
81
|
+
attr_reader original_filename: String
|
|
82
|
+
attr_reader content_type: String
|
|
83
|
+
|
|
84
|
+
# @file: Tempfile
|
|
85
|
+
|
|
86
|
+
# private
|
|
87
|
+
|
|
88
|
+
def initialize: (String filename, String content_type) -> void
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
module Part
|
|
92
|
+
def self?.call: [U] (Object & _MultipartInput multipart_input) -> [U, String, String]
|
|
93
|
+
| (multipart_nested_value value) -> ([StringIO, String, String?] | [File | Tempfile, String, String])
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
module MimeTypeDetector
|
|
97
|
+
DEFAULT_MIMETYPE: String
|
|
98
|
+
|
|
99
|
+
def self?.call: (IO | Tempfile file, String filename) -> String?
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
module Transcoder
|
|
3
|
+
class BodyReader
|
|
4
|
+
@body: Object & (_Reader | _Each[String])
|
|
5
|
+
|
|
6
|
+
def initialize: (body_encoder body) -> void
|
|
7
|
+
|
|
8
|
+
def bytesize: () -> (Integer | Float)
|
|
9
|
+
|
|
10
|
+
def read: (?int? length, ?string? outbuf) -> String?
|
|
11
|
+
|
|
12
|
+
def close: () -> void
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
module Transcoder
|
|
3
|
+
class Deflater
|
|
4
|
+
extend Forwardable
|
|
5
|
+
|
|
6
|
+
@body: BodyReader
|
|
7
|
+
@buffer: Response::Buffer?
|
|
8
|
+
@closed: bool
|
|
9
|
+
|
|
10
|
+
attr_reader content_type: String
|
|
11
|
+
|
|
12
|
+
def initialize: (body_encoder body) -> void
|
|
13
|
+
|
|
14
|
+
def bytesize: () -> (Integer | Float)
|
|
15
|
+
|
|
16
|
+
def read: (?int? length, ?string? outbuf) -> String?
|
|
17
|
+
|
|
18
|
+
def close: () -> void
|
|
19
|
+
|
|
20
|
+
def deflate: (String? chunk) -> String?
|
|
21
|
+
|
|
22
|
+
private
|
|
23
|
+
|
|
24
|
+
def buffer_deflate!: () -> void
|
|
25
|
+
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
data/sig/transcoder.rbs
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
module HTTPX
|
|
2
|
+
type bodyIO = _Reader | _Each[String] | _ToS
|
|
3
|
+
|
|
4
|
+
type body_encoder = (Transcoder::_Encoder & _ToS) | (Transcoder::_Encoder & _Reader) | (Transcoder::_Encoder & _Each[String])
|
|
5
|
+
|
|
6
|
+
module Transcoder
|
|
7
|
+
def self?.normalize_keys: [U] (_ToS key, _ToAry[untyped] | _ToHash[_ToS, untyped] | untyped value, ?(^(untyped value) -> bool | nil) cond) { (String, ?untyped) -> U } -> U
|
|
8
|
+
|
|
9
|
+
def self?.normalize_query: (Hash[String, untyped] params, String name, String v, Integer depth) -> void
|
|
10
|
+
|
|
11
|
+
interface _Encode
|
|
12
|
+
def encode: (untyped payload) -> body_encoder
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
interface _Decode
|
|
16
|
+
def decode: (HTTPX::Response response) -> _Decoder
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
interface _Encoder
|
|
20
|
+
def bytesize: () -> (Integer | Float)
|
|
21
|
+
|
|
22
|
+
def content_type: () -> String
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
interface _Decoder
|
|
26
|
+
def call: (Response response, *untyped) -> untyped
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
interface _Inflater
|
|
30
|
+
def initialize: (Integer | Float bytesize) -> void
|
|
31
|
+
|
|
32
|
+
def call: (String chunk) -> String
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
interface _Deflater
|
|
36
|
+
def initialize: (Response body) -> void
|
|
37
|
+
|
|
38
|
+
def deflate: () -> void
|
|
39
|
+
|
|
40
|
+
def call: (StringIO | File buffer, ?chunk_size: Integer) ?{ (String chunk) -> void } -> void
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|