httpx 0.22.5 → 0.23.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/doc/release_notes/0_23_0.md +42 -0
  3. data/doc/release_notes/0_23_1.md +5 -0
  4. data/lib/httpx/adapters/datadog.rb +1 -1
  5. data/lib/httpx/adapters/faraday.rb +1 -1
  6. data/lib/httpx/adapters/sentry.rb +4 -4
  7. data/lib/httpx/adapters/webmock.rb +2 -2
  8. data/lib/httpx/buffer.rb +4 -0
  9. data/lib/httpx/chainable.rb +4 -4
  10. data/lib/httpx/connection/http1.rb +2 -2
  11. data/lib/httpx/connection/http2.rb +2 -3
  12. data/lib/httpx/connection.rb +29 -10
  13. data/lib/httpx/io/udp.rb +2 -0
  14. data/lib/httpx/io/unix.rb +1 -5
  15. data/lib/httpx/io.rb +0 -10
  16. data/lib/httpx/options.rb +16 -2
  17. data/lib/httpx/plugins/authentication/digest.rb +1 -1
  18. data/lib/httpx/plugins/aws_sdk_authentication.rb +1 -3
  19. data/lib/httpx/plugins/aws_sigv4.rb +1 -1
  20. data/lib/httpx/plugins/compression/brotli.rb +4 -4
  21. data/lib/httpx/plugins/compression/deflate.rb +12 -7
  22. data/lib/httpx/plugins/compression/gzip.rb +7 -5
  23. data/lib/httpx/plugins/compression.rb +9 -8
  24. data/lib/httpx/plugins/digest_authentication.rb +1 -4
  25. data/lib/httpx/plugins/follow_redirects.rb +1 -1
  26. data/lib/httpx/plugins/grpc/message.rb +3 -1
  27. data/lib/httpx/plugins/grpc.rb +3 -3
  28. data/lib/httpx/plugins/h2c.rb +5 -9
  29. data/lib/httpx/plugins/internal_telemetry.rb +16 -0
  30. data/lib/httpx/plugins/multipart.rb +14 -2
  31. data/lib/httpx/plugins/proxy/http.rb +4 -4
  32. data/lib/httpx/plugins/proxy.rb +65 -31
  33. data/lib/httpx/plugins/response_cache.rb +2 -2
  34. data/lib/httpx/plugins/retries.rb +49 -2
  35. data/lib/httpx/plugins/upgrade/h2.rb +3 -3
  36. data/lib/httpx/plugins/upgrade.rb +4 -7
  37. data/lib/httpx/plugins/webdav.rb +7 -7
  38. data/lib/httpx/pool.rb +1 -1
  39. data/lib/httpx/request.rb +23 -13
  40. data/lib/httpx/resolver/https.rb +37 -20
  41. data/lib/httpx/resolver/native.rb +131 -35
  42. data/lib/httpx/resolver.rb +26 -14
  43. data/lib/httpx/response.rb +14 -16
  44. data/lib/httpx/session.rb +1 -0
  45. data/lib/httpx/transcoder/body.rb +0 -1
  46. data/lib/httpx/transcoder/chunker.rb +0 -1
  47. data/lib/httpx/transcoder/form.rb +0 -1
  48. data/lib/httpx/transcoder/json.rb +0 -1
  49. data/lib/httpx/transcoder/xml.rb +0 -1
  50. data/lib/httpx/transcoder.rb +0 -2
  51. data/lib/httpx/version.rb +1 -1
  52. data/lib/httpx.rb +0 -1
  53. data/sig/buffer.rbs +1 -0
  54. data/sig/chainable.rbs +3 -3
  55. data/sig/connection.rbs +17 -6
  56. data/sig/errors.rbs +9 -0
  57. data/sig/httpx.rbs +3 -3
  58. data/sig/io/ssl.rbs +17 -0
  59. data/sig/io/tcp.rbs +57 -0
  60. data/sig/io/udp.rbs +20 -0
  61. data/sig/io/unix.rbs +10 -0
  62. data/sig/options.rbs +5 -1
  63. data/sig/plugins/compression.rbs +6 -2
  64. data/sig/plugins/cookies/jar.rbs +2 -2
  65. data/sig/plugins/grpc.rbs +3 -3
  66. data/sig/plugins/h2c.rbs +1 -1
  67. data/sig/plugins/proxy.rbs +1 -5
  68. data/sig/plugins/response_cache.rbs +1 -1
  69. data/sig/plugins/retries.rbs +28 -8
  70. data/sig/plugins/upgrade.rbs +5 -3
  71. data/sig/request.rbs +6 -2
  72. data/sig/resolver/https.rbs +3 -1
  73. data/sig/resolver/native.rbs +7 -2
  74. data/sig/resolver/resolver.rbs +0 -2
  75. data/sig/resolver/system.rbs +2 -0
  76. data/sig/resolver.rbs +8 -4
  77. data/sig/response.rbs +6 -2
  78. data/sig/session.rbs +10 -10
  79. data/sig/transcoder/xml.rbs +1 -1
  80. data/sig/transcoder.rbs +4 -5
  81. metadata +11 -5
  82. data/lib/httpx/registry.rb +0 -85
  83. data/sig/registry.rbs +0 -13
data/sig/io/tcp.rbs ADDED
@@ -0,0 +1,57 @@
1
+ module HTTPX
2
+ class TCP
3
+ include Loggable
4
+
5
+ attr_reader ip: IPAddr?
6
+
7
+ attr_reader port: Integer
8
+
9
+ attr_reader addresses: Array[ipaddr]
10
+
11
+ attr_reader state: Symbol
12
+
13
+ attr_reader interests: io_interests
14
+
15
+ alias host ip
16
+
17
+ def initialize: (URI::Generic origin, Array[ipaddr]? addresses, options options) -> void
18
+
19
+ def add_addresses: (Array[ipaddr] addrs) -> void
20
+
21
+ def to_io: () -> ::IO
22
+
23
+ def protocol: () -> String
24
+
25
+ def connect: () -> void
26
+
27
+ private
28
+
29
+ # :nocov:
30
+ def try_connect: () -> void
31
+
32
+ public
33
+
34
+ def read: (Integer size, ?(Buffer | String) buffer) -> (0 | nil | untyped)
35
+
36
+ def write: (Buffer buffer) -> Integer?
37
+
38
+ def close: () -> void
39
+
40
+ def connected?: () -> bool
41
+
42
+ def closed?: () -> bool
43
+
44
+ # :nocov:
45
+ def inspect: () -> ::String
46
+
47
+ private
48
+
49
+ def build_socket: () -> Socket
50
+
51
+ def transition: (Symbol nextstate) -> void
52
+
53
+ def do_transition: (Symbol nextstate) -> void
54
+
55
+ def log_transition_state: (Symbol nextstate) -> void
56
+ end
57
+ end
data/sig/io/udp.rbs ADDED
@@ -0,0 +1,20 @@
1
+ module HTTPX
2
+ class UDP
3
+ include Loggable
4
+
5
+ def initialize: (String ip, Integer port, Options options) -> void
6
+
7
+ def to_io: () -> ::IO
8
+
9
+ def connect: () -> void
10
+
11
+ def connected?: () -> bool
12
+
13
+ # :nocov:
14
+ def close: () -> void
15
+
16
+ def read: (Integer size, ?(Buffer | String) buffer) -> Integer?
17
+
18
+ def write: (Buffer buffer) -> Integer?
19
+ end
20
+ end
data/sig/io/unix.rbs ADDED
@@ -0,0 +1,10 @@
1
+ module HTTPX
2
+ class UNIX < TCP
3
+
4
+ attr_reader path: String
5
+
6
+ alias host path
7
+
8
+ def initialize: (URI::HTTP | URI::HTTPS origin, Array[String]? addresses, options options) -> void
9
+ end
10
+ end
data/sig/options.rbs CHANGED
@@ -2,6 +2,7 @@ module HTTPX
2
2
  class Options
3
3
  # include _ToHash
4
4
 
5
+ BUFFER_SIZE: Integer
5
6
  WINDOW_SIZE: Integer
6
7
  MAX_BODY_THRESHOLD_SIZE: Integer
7
8
  CONNECT_TIMEOUT: Integer
@@ -38,11 +39,14 @@ module HTTPX
38
39
  # window_size
39
40
  attr_reader window_size: Integer
40
41
 
42
+ # buffer_size
43
+ attr_reader buffer_size: Integer
44
+
41
45
  # body_threshold_size
42
46
  attr_reader body_threshold_size: Integer
43
47
 
44
48
  # transport
45
- attr_reader transport: String?
49
+ attr_reader transport: "unix" | nil
46
50
 
47
51
  # transport_options
48
52
  attr_reader transport_options: Hash[untyped, untyped]?
@@ -1,7 +1,6 @@
1
1
  module HTTPX
2
2
  module Plugins
3
3
  module Compression
4
- type encodings_registry = Registry[Symbol, Class]
5
4
 
6
5
  type deflatable = _Reader | _ToS
7
6
 
@@ -16,12 +15,17 @@ module HTTPX
16
15
  def initialize: (Integer | Float bytesize) -> untyped
17
16
  end
18
17
 
18
+ interface _Compressor
19
+ def deflater: () -> _Deflater
20
+ def inflater: (Integer | Float bytesize) -> _Inflater
21
+ end
22
+
19
23
  def self.configure: (singleton(Session)) -> void
20
24
 
21
25
  interface _CompressionOptions
22
26
  def compression_threshold_size: () -> Integer?
23
27
 
24
- def encodings: () -> encodings_registry?
28
+ def encodings: () -> Hash[String, _Compressor]
25
29
  end
26
30
 
27
31
  def self.extra_options: (Options) -> (Options & _CompressionOptions)
@@ -13,8 +13,8 @@ module HTTPX
13
13
 
14
14
  def []: (uri) -> Array[Cookie]
15
15
 
16
- def each: (?uri) { (Cookie) -> void } -> void
17
- | (?uri) -> Enumerable[Cookie]
16
+ def each: (?uri?) { (Cookie) -> void } -> void
17
+ | (?uri?) -> Enumerable[Cookie]
18
18
 
19
19
  def merge: (_Each[cookie] cookies) -> instance
20
20
 
data/sig/plugins/grpc.rbs CHANGED
@@ -39,8 +39,8 @@ module HTTPX
39
39
 
40
40
  def self?.encode: (String bytes, ?deflater: Compression::_Deflater?) -> String
41
41
 
42
- def self?.decode: (String message, encodings: Array[String], encoders: Compression::encodings_registry) -> String
43
- | (String message, encodings: Array[String], encoders: Compression::encodings_registry) { (String) -> void } -> void
42
+ def self?.decode: (String message, encodings: Array[String], encoders: Hash[String, Compression::_Compressor]) -> String
43
+ | (String message, encodings: Array[String], encoders: Hash[String, Compression::_Compressor]) { (String) -> void } -> void
44
44
 
45
45
  def self?.cancel: (Request) -> void
46
46
 
@@ -65,7 +65,7 @@ module HTTPX
65
65
  module ResponseMethods
66
66
  def merge_headers: (headers_input trailers) -> void
67
67
 
68
- def encoders: () -> Compression::encodings_registry
68
+ def encoders: () -> Hash[String, Compression::_Compressor]
69
69
  end
70
70
 
71
71
  module InstanceMethods
data/sig/plugins/h2c.rbs CHANGED
@@ -1,7 +1,7 @@
1
1
  module HTTPX
2
2
  module Plugins
3
3
  module H2C
4
- VALID_H2C_VERBS: Array[Symbol]
4
+ VALID_H2C_VERBS: Array[verb]
5
5
 
6
6
  def self.load_dependencies: (*untyped) -> void
7
7
  def self.configure: (singleton(Session)) -> void
@@ -35,11 +35,7 @@ module HTTPX
35
35
  def self.extra_options: (Options) -> (Options & _ProxyOptions)
36
36
 
37
37
  module InstanceMethods
38
- private
39
-
40
- def proxy_uris: (generic_uri, Options & _ProxyOptions) -> { uri: generic_uri, username: String, password: String }
41
- | (generic_uri, Options & _ProxyOptions) -> { uri: generic_uri }
42
- | (generic_uri, Options & _ProxyOptions) -> nil
38
+ @__proxy_uris: Array[generic_uri]
43
39
  end
44
40
  end
45
41
 
@@ -1,7 +1,7 @@
1
1
  module HTTPX
2
2
  module Plugins
3
3
  module ResponseCache
4
- CACHEABLE_VERBS: Array[Symbol]
4
+ CACHEABLE_VERBS: Array[verb]
5
5
 
6
6
  def self?.cacheable_request?: (Request request) -> bool
7
7
  def self?.cacheable_response?: (response response) -> bool
@@ -2,40 +2,60 @@ module HTTPX
2
2
  module Plugins
3
3
  module Retries
4
4
  MAX_RETRIES: Integer
5
- IDEMPOTENT_METHODS: Array[verb]
5
+ IDEMPOTENT_METHODS: Array[String]
6
6
  RETRYABLE_ERRORS: Array[singleton(StandardError)]
7
7
  DEFAULT_JITTER: ^(Numeric) -> Numeric
8
8
 
9
9
  interface _RetryCallback
10
- def call: (response) -> bool?
10
+ def call: (response response) -> bool?
11
11
  end
12
12
 
13
13
  interface _RetriesOptions
14
14
  def retry_after: () -> Numeric?
15
15
 
16
- def retry_jitter: () -> ^(Numeric) -> Numeric
16
+ def retry_jitter: () -> ^(Numeric jitter) -> Numeric
17
17
 
18
- def max_retries: () -> Integer?
18
+ def max_retries: () -> Integer
19
19
 
20
20
  def retry_change_requests: () -> boolish
21
21
 
22
22
  def retry_on: () -> _RetryCallback?
23
23
  end
24
24
 
25
- def self.extra_options: (Options) -> (Options & _RetriesOptions)
25
+ def self.extra_options: (Options options) -> retriesOptions
26
26
 
27
27
  module InstanceMethods
28
28
  def max_retries: (int) -> instance
29
29
 
30
30
  private
31
31
 
32
- def __repeatable_request?: (Request, Options) -> boolish
33
- def __retryable_error?: (_Exception) -> bool
32
+ def __repeatable_request?: (retriesRequest request, retriesOptions options) -> boolish
33
+
34
+ def __retryable_error?: (_Exception error) -> bool
35
+
36
+ def __try_partial_retry: (retriesRequest request, (retriesResponse | ErrorResponse) response) -> void
37
+
34
38
  end
35
39
 
36
40
  module RequestMethods
37
- def retries: () -> Integer
41
+ @options: Options & _RetriesOptions
42
+
43
+ attr_accessor retries: Integer
44
+
45
+ attr_writer partial_response: Response?
46
+
47
+ def response=: (retriesResponse | ErrorResponse response) -> void
38
48
  end
49
+
50
+ module ResponseMethods
51
+ def from_partial_response: (Response response) -> void
52
+ end
53
+
54
+ type retriesOptions = Options & _RetriesOptions
55
+
56
+ type retriesRequest = Request & RequestMethods
57
+
58
+ type retriesResponse = Response & ResponseMethods
39
59
  end
40
60
 
41
61
  type sessionRetries = Session & Retries::InstanceMethods
@@ -1,18 +1,20 @@
1
1
  module HTTPX
2
2
  module Plugins
3
3
  module Upgrade
4
- type handlers_registry = Registry[Symbol, Class]
4
+ interface _Upgrader
5
+ def call: (Connection connection, Request request, Response response) -> void
6
+ end
5
7
 
6
8
  def self.configure: (singleton(Session)) -> void
7
9
 
8
10
  interface _UpgradeOptions
9
- def upgrade_handlers: () -> handlers_registry?
11
+ def upgrade_handlers: () -> Hash[String, _Upgrader]
10
12
  end
11
13
 
12
14
  def self.extra_options: (Options) -> (Options & _UpgradeOptions)
13
15
 
14
16
  module ConnectionMethods
15
- attr_reader upgrade_protocol: Symbol?
17
+ attr_reader upgrade_protocol: String?
16
18
  attr_reader hijacked: boolish
17
19
 
18
20
  def hijack_io: () -> void
data/sig/request.rbs CHANGED
@@ -6,8 +6,8 @@ module HTTPX
6
6
  METHODS: Array[Symbol]
7
7
  USER_AGENT: String
8
8
 
9
- attr_reader verb: Symbol
10
- attr_reader uri: URI::Generic
9
+ attr_reader verb: verb
10
+ attr_reader uri: URI::HTTP | URI::HTTPS
11
11
  attr_reader headers: Headers
12
12
  attr_reader body: Body
13
13
  attr_reader state: Symbol
@@ -56,6 +56,10 @@ module HTTPX
56
56
 
57
57
  def request_timeout: () -> Numeric
58
58
 
59
+ private
60
+
61
+ def initialize_body: (Options options) -> Transcoder::_Encoder?
62
+
59
63
  class Body
60
64
  @headers: Headers
61
65
  @body: body_encoder?
@@ -34,7 +34,9 @@ module HTTPX
34
34
 
35
35
  def build_request: (String hostname) -> Request
36
36
 
37
- def decode_response_body: (Response) -> Array[dns_result]?
37
+ def decode_response_body: (Response) -> dns_decoding_response
38
+
39
+ def reset_hostname: (String hostname, ?reset_candidates: bool) -> Connection?
38
40
  end
39
41
  end
40
42
  end
@@ -11,7 +11,8 @@ module HTTPX
11
11
 
12
12
  @options: Options
13
13
  @ns_index: Integer
14
- @nameserver: Array[String]?
14
+ @nameserver: Array[String]
15
+ @socket_type: :udp | :tcp
15
16
  @ndots: Integer
16
17
  @start_timeout: Float?
17
18
  @search: Array[String]
@@ -20,6 +21,8 @@ module HTTPX
20
21
  @connections: Array[Connection]
21
22
  @read_buffer: String
22
23
  @write_buffer: Buffer
24
+ @large_packet: Buffer?
25
+ @io: UDP | TCP
23
26
 
24
27
  attr_reader state: Symbol
25
28
 
@@ -54,11 +57,13 @@ module HTTPX
54
57
 
55
58
  def generate_candidates: (String) -> Array[String]
56
59
 
57
- def build_socket: () -> void
60
+ def build_socket: () -> (UDP | TCP)
58
61
 
59
62
  def transition: (Symbol nextstate) -> void
60
63
 
61
64
  def handle_error: (NativeResolveError | StandardError) -> void
65
+
66
+ def reset_hostname: (String hostname, ?reset_candidates: bool) -> void
62
67
  end
63
68
  end
64
69
  end
@@ -6,8 +6,6 @@ module HTTPX
6
6
 
7
7
  RECORD_TYPES: Hash[Integer, singleton(Resolv::DNS::Resource)]
8
8
 
9
- attr_reader family: ip_family?
10
-
11
9
  @record_type: singleton(Resolv::DNS::Resource)
12
10
  @options: Options
13
11
  @resolver_options: Hash[Symbol, untyped]
@@ -5,6 +5,8 @@ module HTTPX
5
5
 
6
6
  @resolver: Resolv::DNS
7
7
 
8
+ attr_reader family: nil
9
+
8
10
  def <<: (Connection) -> void
9
11
 
10
12
  private
data/sig/resolver.rbs CHANGED
@@ -2,8 +2,6 @@ module HTTPX
2
2
  type ipaddr = IPAddr | String
3
3
 
4
4
  module Resolver
5
- extend Registry[Symbol, Class]
6
-
7
5
  RESOLVE_TIMEOUT: Integer | Float
8
6
 
9
7
  @lookup_mutex: Thread::Mutex
@@ -13,6 +11,7 @@ module HTTPX
13
11
  type dns_result = { "name" => String, "TTL" => Numeric, "alias" => String }
14
12
  | { "name" => String, "TTL" => Numeric, "data" => String }
15
13
 
14
+ type dns_decoding_response = [:ok, Array[dns_result]] | [:decode_error, Resolv::DNS::DecodeError] | [:dns_error, Integer] | Symbol
16
15
 
17
16
  def nolookup_resolve: (String hostname) -> Array[IPAddr]
18
17
 
@@ -20,6 +19,11 @@ module HTTPX
20
19
 
21
20
  def system_resolve: (String hostname) -> Array[IPAddr]?
22
21
 
22
+ def self?.resolver_for: (:native resolver_type) -> singleton(Native) |
23
+ (:system resolver_type) -> singleton(System) |
24
+ (:https resolver_type) -> singleton(HTTPS) |
25
+ [U] (U resolver_type) -> U
26
+
23
27
  def self?.cached_lookup: (String hostname) -> Array[IPAddr]?
24
28
 
25
29
  def self?.cached_lookup_set: (String hostname, ip_family family, Array[dns_result] addresses) -> void
@@ -28,8 +32,8 @@ module HTTPX
28
32
 
29
33
  def self?.generate_id: () -> Integer
30
34
 
31
- def self?.encode_dns_query: (String hostname, ?type: dns_resource) -> String
35
+ def self?.encode_dns_query: (String hostname, ?type: dns_resource, ?message_id: Integer) -> String
32
36
 
33
- def self?.decode_dns_answer: (String) -> Array[dns_result]?
37
+ def self?.decode_dns_answer: (String) -> dns_decoding_response
34
38
  end
35
39
  end
data/sig/response.rbs CHANGED
@@ -41,14 +41,14 @@ module HTTPX
41
41
  def initialize: (Request request, String | Integer status, String version, headers?) -> untyped
42
42
  def no_data?: () -> bool
43
43
 
44
- def decode:(String format, ?untyped options) -> untyped
44
+ def decode:(Transcoder::_Decode transcoder, ?untyped options) -> untyped
45
45
 
46
46
  class Body
47
47
  include _Reader
48
48
  include _ToS
49
49
  include _ToStr
50
50
 
51
- attr_reader encoding: String
51
+ attr_reader encoding: Encoding | String
52
52
 
53
53
  @response: Response
54
54
  @headers: Headers
@@ -108,10 +108,14 @@ module HTTPX
108
108
 
109
109
  attr_reader request: Request
110
110
 
111
+ attr_reader response: Response?
112
+
111
113
  def status: () -> (Integer | _ToS)
112
114
 
113
115
  def uri: () -> URI::Generic
114
116
 
117
+ def close: () -> void
118
+
115
119
  private
116
120
 
117
121
  def initialize: (Request, Exception, options) -> untyped
data/sig/session.rbs CHANGED
@@ -11,13 +11,11 @@ module HTTPX
11
11
 
12
12
  def self.plugin: (Symbol | Module plugin, ?options? options) ?{ (Class) -> void } -> singleton(Session)
13
13
 
14
- def self.default_options: -> Options
15
-
16
14
  def wrap: () { (instance) -> void } -> void
17
15
 
18
16
  def close: (*untyped) -> void
19
17
 
20
- def build_request: (String | verb, generic_uri, ?options) -> Request
18
+ def build_request: (verb, generic_uri, ?options) -> Request
21
19
 
22
20
  private
23
21
 
@@ -27,7 +25,7 @@ module HTTPX
27
25
  def pool: -> Pool
28
26
  def on_response: (Request, response) -> void
29
27
  def on_promise: (untyped, untyped) -> void
30
- def fetch_response: (Request request, untyped, untyped) -> response?
28
+ def fetch_response: (Request request, Array[Connection] connections, untyped options) -> response?
31
29
 
32
30
  def find_connection: (Request, Array[Connection] connections, Options options) -> Connection
33
31
 
@@ -35,18 +33,20 @@ module HTTPX
35
33
 
36
34
  def build_altsvc_connection: (Connection existing_connection, Array[Connection] connections, URI::Generic alt_origin, String origin, Hash[String, String] alt_params, Options options) -> Connection?
37
35
 
38
- def build_requests: (verb | string, uri, options) -> Array[Request]
39
- | (Array[[verb | string, uri, options]], options) -> Array[Request]
40
- | (Array[[verb | string, uri]], options) -> Array[Request]
41
- | (verb | string, _Each[[uri, options]], Options) -> Array[Request]
42
- | (verb | string, _Each[uri], options) -> Array[Request]
36
+ def build_requests: (verb, uri, options) -> Array[Request]
37
+ | (Array[[verb, uri, options]], options) -> Array[Request]
38
+ | (Array[[verb, uri]], options) -> Array[Request]
39
+ | (verb, _Each[[uri, options]], Options) -> Array[Request]
40
+ | (verb, _Each[uri], options) -> Array[Request]
43
41
 
44
- def build_connection: (URI::Generic, Options) -> Connection
42
+ def build_connection: (URI::HTTP | URI::HTTPS uri, Options options) -> Connection
45
43
 
46
44
  def send_requests: (*Request) -> Array[response]
47
45
 
48
46
  def _send_requests: (Array[Request]) -> Array[Connection]
49
47
 
50
48
  def receive_requests: (Array[Request], Array[Connection]) -> Array[response]
49
+
50
+ attr_reader self.default_options: Options
51
51
  end
52
52
  end
@@ -1,5 +1,5 @@
1
1
  module HTTPX::Transcoder
2
- module XML
2
+ module Xml
3
3
 
4
4
  def self?.encode: (untyped xml) -> Encoder
5
5
  def self?.decode: (HTTPX::Response response) -> _Decoder
data/sig/transcoder.rbs CHANGED
@@ -4,11 +4,6 @@ module HTTPX
4
4
  type body_encoder = Transcoder::_Encoder | _Each[String]
5
5
 
6
6
  module Transcoder
7
- def self?.registry: (String tag) -> _Encode
8
- | () -> Hash[String, _Encode]
9
-
10
- def self?.register: (String tag, _Encode handler) -> void
11
-
12
7
  def self?.normalize_keys: [U] (_ToS key, _ToAry[untyped] | _ToHash[_ToS, untyped] | untyped value, ?(^(untyped value) -> bool | nil) cond) { (String, ?untyped) -> U } -> U
13
8
 
14
9
  def self?.normalize_query: (Hash[String, untyped] params, String name, String v, Integer depth) -> void
@@ -17,6 +12,10 @@ module HTTPX
17
12
  def encode: (untyped payload) -> body_encoder
18
13
  end
19
14
 
15
+ interface _Decode
16
+ def decode: (HTTPX::Response response) -> _Decoder
17
+ end
18
+
20
19
  interface _Encoder
21
20
  def bytesize: () -> (Integer | Float)
22
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httpx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.5
4
+ version: 0.23.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiago Cardoso
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-28 00:00:00.000000000 Z
11
+ date: 2023-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http-2-next
@@ -94,6 +94,8 @@ extra_rdoc_files:
94
94
  - doc/release_notes/0_22_3.md
95
95
  - doc/release_notes/0_22_4.md
96
96
  - doc/release_notes/0_22_5.md
97
+ - doc/release_notes/0_23_0.md
98
+ - doc/release_notes/0_23_1.md
97
99
  - doc/release_notes/0_2_0.md
98
100
  - doc/release_notes/0_2_1.md
99
101
  - doc/release_notes/0_3_0.md
@@ -180,6 +182,8 @@ files:
180
182
  - doc/release_notes/0_22_3.md
181
183
  - doc/release_notes/0_22_4.md
182
184
  - doc/release_notes/0_22_5.md
185
+ - doc/release_notes/0_23_0.md
186
+ - doc/release_notes/0_23_1.md
183
187
  - doc/release_notes/0_2_0.md
184
188
  - doc/release_notes/0_2_1.md
185
189
  - doc/release_notes/0_3_0.md
@@ -276,7 +280,6 @@ files:
276
280
  - lib/httpx/pmatch_extensions.rb
277
281
  - lib/httpx/pool.rb
278
282
  - lib/httpx/punycode.rb
279
- - lib/httpx/registry.rb
280
283
  - lib/httpx/request.rb
281
284
  - lib/httpx/resolver.rb
282
285
  - lib/httpx/resolver/https.rb
@@ -309,6 +312,10 @@ files:
309
312
  - sig/headers.rbs
310
313
  - sig/httpx.rbs
311
314
  - sig/io.rbs
315
+ - sig/io/ssl.rbs
316
+ - sig/io/tcp.rbs
317
+ - sig/io/udp.rbs
318
+ - sig/io/unix.rbs
312
319
  - sig/loggable.rbs
313
320
  - sig/options.rbs
314
321
  - sig/parser/http1.rbs
@@ -348,7 +355,6 @@ files:
348
355
  - sig/plugins/stream.rbs
349
356
  - sig/plugins/upgrade.rbs
350
357
  - sig/pool.rbs
351
- - sig/registry.rbs
352
358
  - sig/request.rbs
353
359
  - sig/resolver.rbs
354
360
  - sig/resolver/https.rbs
@@ -392,7 +398,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
392
398
  - !ruby/object:Gem::Version
393
399
  version: '0'
394
400
  requirements: []
395
- rubygems_version: 3.3.7
401
+ rubygems_version: 3.4.6
396
402
  signing_key:
397
403
  specification_version: 4
398
404
  summary: HTTPX, to the future, and beyond