httpx 0.15.1 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- 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/lib/httpx.rb +6 -3
- data/lib/httpx/adapters/faraday.rb +3 -11
- data/lib/httpx/buffer.rb +1 -1
- data/lib/httpx/callbacks.rb +1 -1
- data/lib/httpx/chainable.rb +15 -8
- data/lib/httpx/connection.rb +2 -2
- data/lib/httpx/connection/http1.rb +3 -1
- data/lib/httpx/connection/http2.rb +1 -11
- data/lib/httpx/errors.rb +11 -11
- data/lib/httpx/io/ssl.rb +2 -2
- data/lib/httpx/io/tls.rb +1 -1
- data/lib/httpx/loggable.rb +1 -1
- data/lib/httpx/options.rb +81 -74
- data/lib/httpx/parser/http1.rb +1 -1
- data/lib/httpx/plugins/aws_sigv4.rb +10 -9
- data/lib/httpx/plugins/compression.rb +12 -11
- data/lib/httpx/plugins/cookies.rb +20 -7
- data/lib/httpx/plugins/cookies/cookie.rb +4 -3
- data/lib/httpx/plugins/cookies/jar.rb +24 -1
- data/lib/httpx/plugins/digest_authentication.rb +15 -11
- data/lib/httpx/plugins/expect.rb +19 -15
- data/lib/httpx/plugins/follow_redirects.rb +9 -9
- data/lib/httpx/plugins/grpc.rb +73 -47
- data/lib/httpx/plugins/grpc/call.rb +4 -1
- data/lib/httpx/plugins/ntlm_authentication.rb +8 -6
- data/lib/httpx/plugins/proxy.rb +4 -6
- data/lib/httpx/plugins/proxy/socks4.rb +2 -1
- data/lib/httpx/plugins/proxy/socks5.rb +2 -1
- data/lib/httpx/plugins/proxy/ssh.rb +9 -9
- data/lib/httpx/plugins/retries.rb +25 -21
- data/lib/httpx/plugins/upgrade.rb +7 -6
- data/lib/httpx/registry.rb +1 -1
- data/lib/httpx/request.rb +4 -12
- data/lib/httpx/resolver/https.rb +0 -2
- data/lib/httpx/response.rb +45 -18
- data/lib/httpx/selector.rb +13 -12
- data/lib/httpx/session.rb +19 -8
- data/lib/httpx/session2.rb +21 -0
- data/lib/httpx/transcoder/body.rb +1 -1
- data/lib/httpx/transcoder/chunker.rb +2 -1
- data/lib/httpx/version.rb +1 -1
- data/sig/buffer.rbs +2 -0
- data/sig/chainable.rbs +24 -28
- data/sig/connection.rbs +20 -8
- data/sig/connection/http1.rbs +3 -3
- data/sig/connection/http2.rbs +1 -1
- data/sig/errors.rbs +35 -1
- data/sig/headers.rbs +5 -5
- data/sig/httpx.rbs +4 -1
- data/sig/loggable.rbs +3 -1
- data/sig/options.rbs +35 -32
- data/sig/plugins/authentication.rbs +1 -1
- data/sig/plugins/aws_sdk_authentication.rbs +5 -1
- data/sig/plugins/aws_sigv4.rbs +1 -2
- data/sig/plugins/basic_authentication.rbs +1 -1
- data/sig/plugins/compression.rbs +4 -6
- data/sig/plugins/cookies.rbs +4 -5
- data/sig/plugins/cookies/cookie.rbs +5 -7
- data/sig/plugins/cookies/jar.rbs +9 -10
- data/sig/plugins/digest_authentication.rbs +2 -3
- data/sig/plugins/expect.rbs +2 -4
- data/sig/plugins/follow_redirects.rbs +3 -5
- data/sig/plugins/grpc.rbs +4 -7
- data/sig/plugins/h2c.rbs +0 -2
- data/sig/plugins/multipart.rbs +2 -4
- data/sig/plugins/ntlm_authentication.rbs +2 -3
- data/sig/plugins/persistent.rbs +3 -8
- data/sig/plugins/proxy.rbs +7 -7
- data/sig/plugins/proxy/ssh.rbs +4 -4
- data/sig/plugins/push_promise.rbs +0 -2
- data/sig/plugins/retries.rbs +4 -8
- data/sig/plugins/stream.rbs +1 -1
- data/sig/plugins/upgrade.rbs +2 -3
- data/sig/pool.rbs +1 -2
- data/sig/registry.rbs +1 -1
- data/sig/request.rbs +2 -2
- data/sig/resolver.rbs +7 -0
- data/sig/resolver/native.rbs +9 -5
- data/sig/resolver/resolver_mixin.rbs +4 -5
- data/sig/resolver/system.rbs +2 -0
- data/sig/response.rbs +17 -11
- data/sig/selector.rbs +7 -6
- data/sig/session.rbs +19 -14
- data/sig/transcoder.rbs +11 -4
- data/sig/transcoder/body.rbs +6 -1
- data/sig/transcoder/chunker.rbs +8 -2
- data/sig/transcoder/form.rbs +2 -1
- data/sig/transcoder/json.rbs +1 -0
- data/sig/utils.rbs +2 -0
- metadata +12 -2
data/lib/httpx/session.rb
CHANGED
@@ -15,8 +15,6 @@ module HTTPX
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def wrap
|
18
|
-
return unless block_given?
|
19
|
-
|
20
18
|
begin
|
21
19
|
prev_persistent = @persistent
|
22
20
|
@persistent = true
|
@@ -31,6 +29,8 @@ module HTTPX
|
|
31
29
|
end
|
32
30
|
|
33
31
|
def request(*args, **options)
|
32
|
+
raise ArgumentError, "must perform at least one request" if args.empty?
|
33
|
+
|
34
34
|
requests = args.first.is_a?(Request) ? args : build_requests(*args, options)
|
35
35
|
responses = send_requests(*requests, options)
|
36
36
|
return responses.first if responses.size == 1
|
@@ -247,9 +247,8 @@ module HTTPX
|
|
247
247
|
if !@plugins.include?(pl)
|
248
248
|
@plugins << pl
|
249
249
|
pl.load_dependencies(self, &block) if pl.respond_to?(:load_dependencies)
|
250
|
+
|
250
251
|
@default_options = @default_options.dup
|
251
|
-
@default_options = pl.extra_options(@default_options, &block) if pl.respond_to?(:extra_options)
|
252
|
-
@default_options = @default_options.merge(options) if options
|
253
252
|
|
254
253
|
include(pl::InstanceMethods) if defined?(pl::InstanceMethods)
|
255
254
|
extend(pl::ClassMethods) if defined?(pl::ClassMethods)
|
@@ -266,14 +265,26 @@ module HTTPX
|
|
266
265
|
opts.response_body_class.__send__(:include, pl::ResponseBodyMethods) if defined?(pl::ResponseBodyMethods)
|
267
266
|
opts.response_body_class.extend(pl::ResponseBodyClassMethods) if defined?(pl::ResponseBodyClassMethods)
|
268
267
|
opts.connection_class.__send__(:include, pl::ConnectionMethods) if defined?(pl::ConnectionMethods)
|
268
|
+
if defined?(pl::OptionsMethods)
|
269
|
+
opts.options_class.__send__(:include, pl::OptionsMethods)
|
270
|
+
|
271
|
+
(pl::OptionsMethods.instance_methods - Object.instance_methods).each do |meth|
|
272
|
+
opts.options_class.method_added(meth)
|
273
|
+
end
|
274
|
+
@default_options = opts.options_class.new(opts)
|
275
|
+
end
|
276
|
+
|
277
|
+
@default_options = pl.extra_options(@default_options) if pl.respond_to?(:extra_options)
|
278
|
+
@default_options = @default_options.merge(options) if options
|
279
|
+
|
269
280
|
pl.configure(self, &block) if pl.respond_to?(:configure)
|
270
281
|
|
271
282
|
@default_options.freeze
|
272
283
|
elsif options
|
273
284
|
# this can happen when two plugins are loaded, an one of them calls the other under the hood,
|
274
285
|
# albeit changing some default.
|
275
|
-
@default_options = @default_options.
|
276
|
-
@default_options = @default_options.merge(options)
|
286
|
+
@default_options = pl.extra_options(@default_options) if pl.respond_to?(:extra_options)
|
287
|
+
@default_options = @default_options.merge(options) if options
|
277
288
|
|
278
289
|
@default_options.freeze
|
279
290
|
end
|
@@ -283,8 +294,8 @@ module HTTPX
|
|
283
294
|
# :nocov:
|
284
295
|
def plugins(pls)
|
285
296
|
warn ":#{__method__} is deprecated, use :plugin instead"
|
286
|
-
pls.each do |pl
|
287
|
-
plugin(pl
|
297
|
+
pls.each do |pl|
|
298
|
+
plugin(pl)
|
288
299
|
end
|
289
300
|
self
|
290
301
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require_relative "session"
|
2
|
+
module HTTPX
|
3
|
+
class Session
|
4
|
+
def initialize(options = EMPTY_HASH, &blk)
|
5
|
+
@options = self.class.default_options.merge(options)
|
6
|
+
@responses = {}
|
7
|
+
@persistent = @options.persistent
|
8
|
+
wrap(&blk) if block_given?
|
9
|
+
end
|
10
|
+
|
11
|
+
def wrap
|
12
|
+
begin
|
13
|
+
prev_persistent = @persistent
|
14
|
+
@persistent = true
|
15
|
+
yield self
|
16
|
+
ensure
|
17
|
+
@persistent = prev_persistent
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/httpx/version.rb
CHANGED
data/sig/buffer.rbs
CHANGED
data/sig/chainable.rbs
CHANGED
@@ -3,41 +3,37 @@ module HTTPX
|
|
3
3
|
def request: (*untyped, **untyped) -> (response | Array[response])
|
4
4
|
def accept: (String) -> Session
|
5
5
|
def wrap: () { (Session) -> void } -> void
|
6
|
-
| () -> void
|
7
6
|
|
8
7
|
def with: (options) -> Session
|
9
|
-
| (options) { (Session) ->
|
8
|
+
| (options) { (Session) -> void } -> void
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
| (:
|
16
|
-
| (:
|
17
|
-
| (:
|
18
|
-
| (:
|
19
|
-
| (:
|
20
|
-
| (:
|
21
|
-
| (:
|
22
|
-
| (:
|
23
|
-
| (:
|
24
|
-
| (:
|
25
|
-
| (:
|
26
|
-
| (:
|
27
|
-
| (:
|
28
|
-
| (:
|
29
|
-
| (:
|
30
|
-
| (:
|
31
|
-
| (
|
32
|
-
| (
|
33
|
-
| (:grpc) -> Plugins::grpcSession
|
34
|
-
| (Symbol | Module, ?options?) { (Class) -> void } -> Session
|
35
|
-
| (Symbol | Module, ?options?) -> Session
|
10
|
+
def plugin: (:authentication, ?options) -> Plugins::sessionAuthentication
|
11
|
+
| (:basic_authentication, ?options) -> Plugins::sessionBasicAuthentication
|
12
|
+
| (:digest_authentication, ?options) -> Plugins::sessionDigestAuthentication
|
13
|
+
| (:ntlm_authentication, ?options) -> Plugins::sessionNTLMAuthentication
|
14
|
+
| (:aws_sdk_authentication, ?options) -> Plugins::sessionAwsSdkAuthentication
|
15
|
+
| (:compression, ?options) -> Session
|
16
|
+
| (:cookies, ?options) -> Plugins::sessionCookies
|
17
|
+
| (:expect, ?options) -> Session
|
18
|
+
| (:follow_redirects, ?options) -> Plugins::sessionFollowRedirects
|
19
|
+
| (:upgrade, ?options) -> Session
|
20
|
+
| (:h2c, ?options) -> Session
|
21
|
+
| (:multipart, ?options) -> Session
|
22
|
+
| (:persistent, ?options) -> Plugins::sessionPersistent
|
23
|
+
| (:proxy, ?options) -> Plugins::sessionProxy
|
24
|
+
| (:push_promise, ?options) -> Plugins::sessionPushPromise
|
25
|
+
| (:retries, ?options) -> Plugins::sessionRetries
|
26
|
+
| (:rate_limiter, ?options) -> Session
|
27
|
+
| (:stream, ?options) -> Plugins::sessionStream
|
28
|
+
| (:aws_sigv4, ?options) -> Plugins::awsSigV4Session
|
29
|
+
| (:grpc, ?options) -> Plugins::grpcSession
|
30
|
+
| (Symbol | Module, ?options) { (Class) -> void } -> Session
|
31
|
+
| (Symbol | Module, ?options) -> Session
|
36
32
|
|
37
33
|
private
|
38
34
|
|
39
35
|
def default_options: () -> Options
|
40
36
|
def branch: (options) -> Session
|
41
|
-
| (options) { (Session) ->
|
37
|
+
| (options) { (Session) -> void } -> Session
|
42
38
|
end
|
43
39
|
end
|
data/sig/connection.rbs
CHANGED
@@ -1,28 +1,37 @@
|
|
1
1
|
module HTTPX
|
2
2
|
class Connection
|
3
|
+
|
3
4
|
interface _Parser
|
4
5
|
|
5
6
|
def on: (Symbol) { (*untyped) -> void } -> void
|
6
7
|
def empty?: () -> bool
|
8
|
+
# def exhausted?: () -> bool
|
7
9
|
def close: () -> void
|
8
10
|
def consume: () -> void
|
9
11
|
def <<: (string) -> void
|
12
|
+
# def send: (Request) -> void
|
13
|
+
# def ping: () -> void
|
14
|
+
# def timeout: () -> (Integer | Float)
|
15
|
+
|
10
16
|
end
|
11
17
|
|
18
|
+
extend Forwardable
|
12
19
|
include Loggable
|
13
20
|
include Callbacks
|
14
|
-
|
21
|
+
include HTTPX::Registry[String, Class]
|
22
|
+
|
23
|
+
BUFFER_SIZE: Integer
|
15
24
|
|
16
|
-
attr_reader origin:
|
25
|
+
attr_reader origin: URI::Generic
|
17
26
|
attr_reader state: Symbol
|
18
27
|
attr_reader pending: Array[Request]
|
19
|
-
attr_reader options:
|
28
|
+
attr_reader options: Options
|
20
29
|
|
21
30
|
def addresses: () -> Array[ipaddr]?
|
22
31
|
|
23
32
|
def addresses=: (Array[ipaddr]) -> void
|
24
33
|
|
25
|
-
def match?: (
|
34
|
+
def match?: (URI::Generic, options) -> bool
|
26
35
|
|
27
36
|
def mergeable?: (Connection) -> bool
|
28
37
|
|
@@ -35,7 +44,7 @@ module HTTPX
|
|
35
44
|
|
36
45
|
def purge_pending: () { (Request) -> void } -> void
|
37
46
|
|
38
|
-
def match_altsvcs?: (
|
47
|
+
def match_altsvcs?: (URI::Generic uri) -> bool
|
39
48
|
|
40
49
|
def connecting?: () -> bool
|
41
50
|
def inflight?: () -> boolish
|
@@ -55,7 +64,7 @@ module HTTPX
|
|
55
64
|
|
56
65
|
private
|
57
66
|
|
58
|
-
def initialize: (String,
|
67
|
+
def initialize: (String, URI::Generic, options) -> untyped
|
59
68
|
|
60
69
|
def connect: () -> void
|
61
70
|
|
@@ -76,10 +85,13 @@ module HTTPX
|
|
76
85
|
|
77
86
|
def handle_response: () -> void
|
78
87
|
|
79
|
-
def on_error: (StandardError) -> void
|
88
|
+
def on_error: (HTTPX::TimeoutError | Error | StandardError) -> void
|
80
89
|
|
81
90
|
def handle_error: (StandardError) -> void
|
82
91
|
|
83
|
-
def total_timeout: () ->
|
92
|
+
def total_timeout: () -> untyped?
|
93
|
+
# def total_timeout: () -> Timers::Timer?
|
94
|
+
#
|
95
|
+
def purge_after_closed: () -> void
|
84
96
|
end
|
85
97
|
end
|
data/sig/connection/http1.rbs
CHANGED
@@ -9,7 +9,7 @@ module HTTPX
|
|
9
9
|
@options: Options
|
10
10
|
@max_concurrent_requests: Integer
|
11
11
|
@max_requests: Integer
|
12
|
-
@parser: HTTP1
|
12
|
+
@parser: Parser::HTTP1
|
13
13
|
@buffer: Buffer
|
14
14
|
|
15
15
|
def interests: () -> io_interests?
|
@@ -54,7 +54,7 @@ module HTTPX
|
|
54
54
|
|
55
55
|
def disable_pipelining: () -> void
|
56
56
|
|
57
|
-
def set_protocol_headers: (Request) -> _Each[headers_key, String]
|
57
|
+
def set_protocol_headers: (Request) -> _Each[[headers_key, String]]
|
58
58
|
|
59
59
|
def headline_uri: (Request) -> String
|
60
60
|
|
@@ -64,7 +64,7 @@ module HTTPX
|
|
64
64
|
|
65
65
|
def join_trailers: (Request request) -> void
|
66
66
|
|
67
|
-
def join_headers2: (_Each[headers_key, String] headers) -> void
|
67
|
+
def join_headers2: (_Each[[headers_key, String]] headers) -> void
|
68
68
|
|
69
69
|
def join_body: (Request request) -> void
|
70
70
|
|
data/sig/connection/http2.rbs
CHANGED
@@ -45,7 +45,7 @@ module HTTPX
|
|
45
45
|
|
46
46
|
def headline_uri: (Request) -> String
|
47
47
|
|
48
|
-
def set_protocol_headers: (Request) -> _Each[headers_key, String]
|
48
|
+
def set_protocol_headers: (Request) -> _Each[[headers_key, String]]
|
49
49
|
|
50
50
|
def handle: (Request request, HTTP2Next::Stream stream) -> void
|
51
51
|
|
data/sig/errors.rbs
CHANGED
@@ -1,3 +1,37 @@
|
|
1
1
|
module HTTPX
|
2
|
-
Error
|
2
|
+
class Error < StandardError
|
3
|
+
end
|
4
|
+
|
5
|
+
class TimeoutError < Error
|
6
|
+
attr_reader timeout: Numeric
|
7
|
+
|
8
|
+
def to_connection_error: () -> ConnectTimeoutError
|
9
|
+
private
|
10
|
+
|
11
|
+
def initialize: (Numeric timeout, String message) -> untyped
|
12
|
+
end
|
13
|
+
|
14
|
+
class TotalTimeoutError < TimeoutError
|
15
|
+
end
|
16
|
+
|
17
|
+
class ConnectTimeoutError < TimeoutError
|
18
|
+
end
|
19
|
+
|
20
|
+
class SettingsTimeoutError < TimeoutError
|
21
|
+
end
|
22
|
+
|
23
|
+
class ResolveTimeoutError < TimeoutError
|
24
|
+
end
|
25
|
+
|
26
|
+
class ResolveError < Error
|
27
|
+
end
|
28
|
+
|
29
|
+
class NativeResolveError < ResolveError
|
30
|
+
attr_reader connection: Connection
|
31
|
+
attr_reader host: String
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def initialize: (Connection connection, String hostname, ?String message) -> untyped
|
36
|
+
end
|
3
37
|
end
|
data/sig/headers.rbs
CHANGED
@@ -12,15 +12,15 @@ module HTTPX
|
|
12
12
|
def []=: (headers_key field, headers_value value) -> void
|
13
13
|
|
14
14
|
def add: (headers_key field, string value) -> void
|
15
|
-
def delete: (headers_key field) ->
|
15
|
+
def delete: (headers_key field) -> Array[String]?
|
16
16
|
|
17
|
-
def each: (?_Each[headers_key, String]? extra_headers) { (headers_key, String) -> void } -> void
|
18
|
-
| (?_Each[headers_key, String]? extra_headers) -> Enumerable[[headers_key, String]
|
17
|
+
def each: (?_Each[[headers_key, String]]? extra_headers) { (headers_key, String) -> void } -> void
|
18
|
+
| (?_Each[[headers_key, String]]? extra_headers) -> Enumerable[[headers_key, String]]
|
19
19
|
|
20
20
|
def get: (headers_key field) -> Array[String]
|
21
21
|
def key?: (headers_key downcased_key) -> bool
|
22
22
|
|
23
|
-
def merge: (_Each[headers_key, headers_value] other) -> Headers
|
23
|
+
def merge: (_Each[[headers_key, headers_value]] other) -> Headers
|
24
24
|
|
25
25
|
def same_headers?: (untyped headers) -> bool
|
26
26
|
|
@@ -28,7 +28,7 @@ module HTTPX
|
|
28
28
|
def to_hash: () -> Hash[headers_key, String]
|
29
29
|
alias to_h to_hash
|
30
30
|
|
31
|
-
def inspect: () -> String
|
31
|
+
def inspect: () -> String
|
32
32
|
|
33
33
|
private
|
34
34
|
|
data/sig/httpx.rbs
CHANGED
@@ -4,12 +4,15 @@ module HTTPX
|
|
4
4
|
VERSION: String
|
5
5
|
|
6
6
|
type uri = URI::HTTP | URI::HTTPS | string
|
7
|
-
type generic_uri =
|
7
|
+
type generic_uri = String | URI::Generic
|
8
8
|
|
9
9
|
type verb = :options | :get | :head | :post | :put | :delete | :trace | :connect |
|
10
10
|
:propfind | :proppatch | :mkcol | :copy | :move | :lock | :unlock | :orderpatch |
|
11
11
|
:acl | :report | :patch | :search
|
12
12
|
|
13
13
|
module Plugins
|
14
|
+
def self?.load_plugin: (Symbol) -> Module
|
15
|
+
|
16
|
+
def self?.register_plugin: (Symbol, Module) -> void
|
14
17
|
end
|
15
18
|
end
|
data/sig/loggable.rbs
CHANGED
@@ -4,8 +4,10 @@ module HTTPX
|
|
4
4
|
end
|
5
5
|
|
6
6
|
module Loggable
|
7
|
+
COLORS: Hash[Symbol, Integer]
|
8
|
+
|
7
9
|
def log: (?level: Integer?, ?color: Symbol?) { () -> String } -> void
|
8
10
|
|
9
|
-
def log_exception: (
|
11
|
+
def log_exception: (Exception error, ?level: Integer, ?color: Symbol) -> void
|
10
12
|
end
|
11
13
|
end
|
data/sig/options.rbs
CHANGED
@@ -4,108 +4,111 @@ module HTTPX
|
|
4
4
|
|
5
5
|
WINDOW_SIZE: Integer
|
6
6
|
MAX_BODY_THRESHOLD_SIZE: Integer
|
7
|
+
CONNECT_TIMEOUT: Integer
|
8
|
+
OPERATION_TIMEOUT: Integer
|
9
|
+
KEEP_ALIVE_TIMEOUT: Integer
|
10
|
+
SETTINGS_TIMEOUT: Integer
|
11
|
+
DEFAULT_OPTIONS: Hash[Symbol, untyped]
|
7
12
|
|
8
13
|
type timeout_type = :connect_timeout | :settings_timeout | :operation_timeout | :keep_alive_timeout | :total_timeout
|
9
14
|
type timeout = Hash[timeout_type, Numeric?]
|
10
15
|
|
11
|
-
def self.new: (options) -> instance
|
12
|
-
| () -> instance
|
16
|
+
def self.new: (?options) -> instance
|
13
17
|
|
18
|
+
def self.def_option: (Symbol, ?String) -> void
|
19
|
+
| (Symbol) { (*nil) -> untyped } -> void
|
14
20
|
# headers
|
15
21
|
attr_reader uri: URI?
|
16
|
-
def uri=: (uri) -> void
|
17
22
|
|
18
23
|
# headers
|
19
24
|
attr_reader headers: Headers?
|
20
|
-
def headers=: (headers) -> void
|
21
25
|
|
22
26
|
# timeout
|
23
27
|
attr_reader timeout: timeout
|
24
|
-
def timeout=: (timeout) -> void
|
25
28
|
|
26
29
|
# max_concurrent_requests
|
27
30
|
attr_reader max_concurrent_requests: Integer?
|
28
|
-
def max_concurrent_requests=: (Integer) -> void
|
29
31
|
|
30
32
|
# max_requests
|
31
33
|
attr_reader max_requests: Integer?
|
32
|
-
def max_requests=: (Integer) -> void
|
33
34
|
|
34
35
|
# window_size
|
35
|
-
attr_reader window_size:
|
36
|
-
def window_size=: (int) -> void
|
36
|
+
attr_reader window_size: Integer
|
37
37
|
|
38
38
|
# body_threshold_size
|
39
|
-
attr_reader body_threshold_size:
|
40
|
-
def body_threshold_size=: (int) -> void
|
39
|
+
attr_reader body_threshold_size: Integer
|
41
40
|
|
42
41
|
# transport
|
43
|
-
attr_reader transport:
|
44
|
-
def transport=: (_ToS) -> void
|
42
|
+
attr_reader transport: String?
|
45
43
|
|
46
44
|
# transport_options
|
47
45
|
attr_reader transport_options: Hash[untyped, untyped]?
|
48
|
-
def transport_options=: (Hash[untyped, untyped]) -> void
|
49
46
|
|
50
47
|
# addresses
|
51
|
-
attr_reader addresses: _ToAry[
|
52
|
-
def addresses=: (_ToAry[untyped]) -> void
|
48
|
+
attr_reader addresses: _ToAry[ipaddr]?
|
53
49
|
|
54
50
|
# params
|
55
51
|
attr_reader params: Transcoder::urlencoded_input?
|
56
|
-
def params=: (Transcoder::urlencoded_input) -> void
|
57
52
|
|
58
53
|
# form
|
59
54
|
attr_reader form: Transcoder::urlencoded_input?
|
60
|
-
def form=: (Transcoder::urlencoded_input) -> void
|
61
55
|
|
62
56
|
# json
|
63
57
|
attr_reader json: _ToJson?
|
64
|
-
def json=: (_ToJson) -> void
|
65
58
|
|
66
59
|
# body
|
67
60
|
attr_reader body: bodyIO?
|
68
|
-
def body=: (bodyIO) -> void
|
69
61
|
|
70
62
|
# ssl
|
71
63
|
|
72
64
|
# http2_settings
|
73
65
|
|
66
|
+
|
67
|
+
# classes
|
68
|
+
attr_reader connection_class: singleton(Connection)
|
69
|
+
|
70
|
+
attr_reader request_class: singleton(Request)
|
71
|
+
|
72
|
+
attr_reader response_class: singleton(Response)
|
73
|
+
|
74
|
+
attr_reader headers_class: singleton(Headers)
|
75
|
+
|
76
|
+
attr_reader request_body_class: singleton(Request::Body)
|
77
|
+
|
78
|
+
attr_reader response_body_class: singleton(Response::Body)
|
79
|
+
|
80
|
+
attr_reader ssl: Hash[Symbol, untyped]
|
81
|
+
|
74
82
|
# request_class response_class headers_class request_body_class
|
75
83
|
# response_body_class connection_class
|
76
84
|
# resolver_class resolver_options
|
77
85
|
|
78
|
-
# request_class
|
79
|
-
attr_reader request_class: singleton(Request)
|
80
|
-
def request_class=: (singleton(Request)) -> void
|
81
|
-
|
82
86
|
# io
|
83
87
|
type io_option = _ToIO | Hash[String, _ToIO]
|
84
88
|
attr_reader io: io_option?
|
85
|
-
def io=: (io_option) -> void
|
86
89
|
|
87
90
|
# fallback_protocol
|
88
91
|
attr_reader fallback_protocol: String?
|
89
|
-
def fallback_protocol=: (String) -> void
|
90
92
|
|
91
93
|
# debug
|
92
94
|
attr_reader debug: _IOLogger?
|
93
|
-
def debug=: (_IOLogger) -> void
|
94
95
|
|
95
96
|
# debug_level
|
96
|
-
attr_reader debug_level: Integer
|
97
|
-
def debug_level=: (Integer) -> void
|
97
|
+
attr_reader debug_level: Integer
|
98
98
|
|
99
99
|
# persistent
|
100
100
|
attr_reader persistent: bool?
|
101
|
-
|
101
|
+
|
102
|
+
# resolver_options
|
103
|
+
attr_reader resolver_options: Hash[Symbol, untyped]?
|
102
104
|
|
103
105
|
def ==: (untyped other) -> bool
|
104
|
-
def merge: (_ToHash other) -> instance
|
106
|
+
def merge: (_ToHash[Symbol | String, untyped] other) -> instance
|
107
|
+
def to_hash: () -> Hash[Symbol, untyped]
|
105
108
|
|
106
109
|
private
|
107
110
|
|
108
|
-
def initialize: (options) -> untyped
|
111
|
+
def initialize: (?options) -> untyped
|
109
112
|
end
|
110
113
|
|
111
114
|
type options = Options | Hash[Symbol | String, untyped]
|