httpx 0.16.1 → 0.18.2
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 +4 -4
- data/README.md +4 -3
- 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/lib/httpx/adapters/datadog.rb +1 -1
- data/lib/httpx/adapters/faraday.rb +5 -3
- data/lib/httpx/adapters/webmock.rb +9 -3
- data/lib/httpx/altsvc.rb +2 -2
- data/lib/httpx/chainable.rb +4 -4
- data/lib/httpx/connection/http1.rb +23 -14
- data/lib/httpx/connection/http2.rb +35 -17
- data/lib/httpx/connection.rb +74 -76
- data/lib/httpx/domain_name.rb +1 -1
- data/lib/httpx/extensions.rb +50 -4
- data/lib/httpx/headers.rb +1 -1
- data/lib/httpx/io/ssl.rb +5 -1
- data/lib/httpx/io/tls.rb +7 -7
- data/lib/httpx/loggable.rb +5 -5
- data/lib/httpx/options.rb +35 -13
- data/lib/httpx/parser/http1.rb +10 -6
- data/lib/httpx/plugins/aws_sdk_authentication.rb +42 -18
- data/lib/httpx/plugins/aws_sigv4.rb +9 -11
- data/lib/httpx/plugins/compression.rb +5 -3
- data/lib/httpx/plugins/cookies/jar.rb +1 -1
- data/lib/httpx/plugins/digest_authentication.rb +4 -4
- data/lib/httpx/plugins/expect.rb +7 -3
- data/lib/httpx/plugins/grpc/message.rb +2 -2
- data/lib/httpx/plugins/grpc.rb +3 -3
- data/lib/httpx/plugins/h2c.rb +7 -3
- data/lib/httpx/plugins/internal_telemetry.rb +8 -8
- data/lib/httpx/plugins/multipart/decoder.rb +187 -0
- data/lib/httpx/plugins/multipart/mime_type_detector.rb +3 -3
- data/lib/httpx/plugins/multipart/part.rb +2 -2
- data/lib/httpx/plugins/multipart.rb +16 -2
- data/lib/httpx/plugins/ntlm_authentication.rb +4 -4
- data/lib/httpx/plugins/proxy/ssh.rb +11 -4
- data/lib/httpx/plugins/proxy.rb +6 -4
- data/lib/httpx/plugins/response_cache/store.rb +55 -0
- data/lib/httpx/plugins/response_cache.rb +88 -0
- data/lib/httpx/plugins/retries.rb +36 -14
- data/lib/httpx/plugins/stream.rb +3 -4
- data/lib/httpx/pool.rb +39 -13
- data/lib/httpx/registry.rb +1 -1
- data/lib/httpx/request.rb +12 -13
- data/lib/httpx/resolver/https.rb +5 -7
- data/lib/httpx/resolver/native.rb +4 -2
- data/lib/httpx/resolver/resolver_mixin.rb +2 -1
- data/lib/httpx/resolver/system.rb +2 -0
- data/lib/httpx/resolver.rb +2 -2
- data/lib/httpx/response.rb +60 -44
- data/lib/httpx/selector.rb +16 -19
- data/lib/httpx/session.rb +22 -15
- data/lib/httpx/session2.rb +1 -1
- data/lib/httpx/timers.rb +84 -0
- data/lib/httpx/transcoder/body.rb +2 -1
- data/lib/httpx/transcoder/form.rb +20 -0
- data/lib/httpx/transcoder/json.rb +12 -0
- data/lib/httpx/transcoder.rb +62 -1
- data/lib/httpx/utils.rb +10 -2
- data/lib/httpx/version.rb +1 -1
- data/lib/httpx.rb +1 -0
- data/sig/buffer.rbs +2 -2
- data/sig/chainable.rbs +7 -1
- data/sig/connection/http1.rbs +15 -4
- data/sig/connection/http2.rbs +19 -5
- data/sig/connection.rbs +15 -9
- data/sig/headers.rbs +19 -18
- data/sig/options.rbs +13 -5
- data/sig/parser/http1.rbs +3 -3
- data/sig/plugins/aws_sdk_authentication.rbs +22 -4
- data/sig/plugins/aws_sigv4.rbs +12 -3
- data/sig/plugins/basic_authentication.rbs +1 -1
- data/sig/plugins/multipart.rbs +64 -8
- data/sig/plugins/proxy.rbs +6 -6
- data/sig/plugins/response_cache.rbs +35 -0
- data/sig/plugins/retries.rbs +3 -0
- data/sig/pool.rbs +6 -0
- data/sig/request.rbs +11 -8
- data/sig/resolver/native.rbs +2 -1
- data/sig/resolver/resolver_mixin.rbs +1 -1
- data/sig/resolver/system.rbs +3 -1
- data/sig/response.rbs +11 -4
- data/sig/selector.rbs +8 -6
- data/sig/session.rbs +8 -14
- data/sig/timers.rbs +32 -0
- data/sig/transcoder/form.rbs +1 -0
- data/sig/transcoder/json.rbs +1 -0
- data/sig/transcoder.rbs +5 -4
- data/sig/utils.rbs +4 -0
- metadata +18 -17
data/sig/request.rbs
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
module HTTPX
|
2
2
|
class Request
|
3
|
+
extend Forwardable
|
3
4
|
include Callbacks
|
4
5
|
|
5
|
-
METHODS: Array[
|
6
|
+
METHODS: Array[Symbol]
|
6
7
|
USER_AGENT: String
|
7
8
|
|
8
|
-
attr_reader verb:
|
9
|
-
attr_reader uri: URI::
|
9
|
+
attr_reader verb: Symbol
|
10
|
+
attr_reader uri: URI::Generic
|
10
11
|
attr_reader headers: Headers
|
11
12
|
attr_reader body: Body
|
12
13
|
attr_reader state: Symbol
|
@@ -14,13 +15,13 @@ module HTTPX
|
|
14
15
|
attr_reader response: response?
|
15
16
|
attr_reader drain_error: StandardError?
|
16
17
|
|
17
|
-
def initialize: (
|
18
|
+
def initialize: (Symbol | String, generic_uri, ?options) -> untyped
|
18
19
|
|
19
20
|
def interests: () -> (:r | :w)
|
20
21
|
|
21
|
-
def merge_headers: (_Each[[
|
22
|
+
def merge_headers: (_Each[[String, headers_value]]) -> void
|
22
23
|
|
23
|
-
def scheme: () ->
|
24
|
+
def scheme: () -> String
|
24
25
|
|
25
26
|
def response=: (response) -> void
|
26
27
|
|
@@ -49,6 +50,7 @@ module HTTPX
|
|
49
50
|
def each: () { (String) -> void } -> void
|
50
51
|
| () -> Enumerable[String]
|
51
52
|
|
53
|
+
def rewind: () -> void
|
52
54
|
def empty?: () -> bool
|
53
55
|
def bytesize: () -> Numeric
|
54
56
|
def stream: (Transcoder::_Encoder) -> bodyIO
|
@@ -59,8 +61,9 @@ module HTTPX
|
|
59
61
|
end
|
60
62
|
|
61
63
|
class ProcIO
|
62
|
-
|
63
|
-
|
64
|
+
def initialize: (^(String) -> void) -> untyped
|
65
|
+
|
66
|
+
def write: (String data) -> Integer
|
64
67
|
end
|
65
68
|
end
|
66
69
|
end
|
data/sig/resolver/native.rbs
CHANGED
data/sig/resolver/system.rbs
CHANGED
data/sig/response.rbs
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
module HTTPX
|
2
2
|
interface _Response
|
3
|
-
def raise_for_status: () ->
|
3
|
+
def raise_for_status: () -> self
|
4
|
+
|
5
|
+
def error: () -> StandardError?
|
4
6
|
end
|
5
7
|
|
6
8
|
class Response
|
@@ -22,16 +24,22 @@ module HTTPX
|
|
22
24
|
def close: () -> void
|
23
25
|
def uri: () -> URI::Generic
|
24
26
|
|
25
|
-
def merge_headers: (_Each[[
|
27
|
+
def merge_headers: (_Each[[String, headers_value]]) -> void
|
26
28
|
def bodyless?: () -> bool
|
27
29
|
def content_type: () -> ContentType
|
28
30
|
def complete?: () -> bool
|
29
31
|
|
32
|
+
def json: (?json_options opts) -> untyped
|
33
|
+
|
34
|
+
def form: () -> Hash[String, untyped]
|
35
|
+
|
30
36
|
private
|
31
37
|
|
32
38
|
def initialize: (Request request, String | Integer status, String version, headers?) -> untyped
|
33
39
|
def no_data?: () -> bool
|
34
40
|
|
41
|
+
def decode:(String format, ?untyped options) -> untyped
|
42
|
+
|
35
43
|
class Body
|
36
44
|
include _Reader
|
37
45
|
include _ToS
|
@@ -73,7 +81,7 @@ module HTTPX
|
|
73
81
|
|
74
82
|
private
|
75
83
|
|
76
|
-
def initialize: (String
|
84
|
+
def initialize: (String? header_value) -> void
|
77
85
|
end
|
78
86
|
|
79
87
|
class ErrorResponse
|
@@ -83,7 +91,6 @@ module HTTPX
|
|
83
91
|
@options: Options
|
84
92
|
|
85
93
|
attr_reader request: Request
|
86
|
-
attr_reader error: Exception
|
87
94
|
|
88
95
|
def status: () -> (Integer | _ToS)
|
89
96
|
|
data/sig/selector.rbs
CHANGED
@@ -1,20 +1,22 @@
|
|
1
1
|
module HTTPX
|
2
2
|
class Selector
|
3
|
+
type selectable = Connection | Resolver::Native | Resolver::HTTPS
|
4
|
+
|
3
5
|
READABLE: Array[Symbol]
|
4
6
|
WRITABLE: Array[Symbol]
|
5
|
-
@selectables: Array[
|
7
|
+
@selectables: Array[selectable]
|
6
8
|
|
7
|
-
def register: (
|
8
|
-
def deregister: (
|
9
|
+
def register: (selectable) -> void
|
10
|
+
def deregister: (selectable) -> void
|
9
11
|
|
10
|
-
def select: (Numeric? interval) { (
|
12
|
+
def select: (Numeric? interval) { (selectable) -> void } -> void
|
11
13
|
|
12
14
|
private
|
13
15
|
|
14
16
|
def initialize: () -> untyped
|
15
17
|
|
16
|
-
def select_many: (Numeric? interval) { (
|
17
|
-
def select_one: (Numeric? interval) { (
|
18
|
+
def select_many: (Numeric? interval) { (selectable) -> void } -> void
|
19
|
+
def select_one: (Numeric? interval) { (selectable) -> void } -> void
|
18
20
|
end
|
19
21
|
|
20
22
|
type io_interests = :r | :w | :rw
|
data/sig/session.rbs
CHANGED
@@ -9,25 +9,19 @@ module HTTPX
|
|
9
9
|
@responses: Hash[Request, response]
|
10
10
|
@persistent: bool?
|
11
11
|
|
12
|
+
def self.plugin: (Symbol | Module plugin, ?options? options) ?{ (Class) -> void } -> singleton(Session)
|
13
|
+
|
14
|
+
def self.default_options: -> Options
|
15
|
+
|
12
16
|
def wrap: () { (instance) -> void } -> void
|
13
17
|
|
14
18
|
def close: (*untyped) -> void
|
15
19
|
|
16
|
-
def request: (*Request, **untyped) -> (response | Array[response])
|
17
|
-
| (*untyped, **untyped) -> (response | Array[response])
|
18
|
-
|
19
20
|
def build_request: (String | verb, generic_uri, ?options) -> Request
|
20
21
|
|
21
|
-
# def self.plugin: (Symbol | Module, ?options) { (Class) -> void } -> singleton(Session)
|
22
|
-
# | (Symbol | Module, ?options) -> singleton(Session)
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
def self.default_options: -> Options
|
27
|
-
|
28
22
|
private
|
29
23
|
|
30
|
-
def initialize: (?options) { (
|
24
|
+
def initialize: (?options) { (self) -> void } -> untyped
|
31
25
|
| (?options) -> untyped
|
32
26
|
|
33
27
|
def pool: -> Pool
|
@@ -49,10 +43,10 @@ module HTTPX
|
|
49
43
|
|
50
44
|
def build_connection: (URI::Generic, Options) -> Connection
|
51
45
|
|
52
|
-
def send_requests: (*Request
|
46
|
+
def send_requests: (*Request) -> Array[response]
|
53
47
|
|
54
|
-
def _send_requests: (Array[Request]
|
48
|
+
def _send_requests: (Array[Request]) -> Array[Connection]
|
55
49
|
|
56
|
-
def receive_requests: (Array[Request], Array[Connection]
|
50
|
+
def receive_requests: (Array[Request], Array[Connection]) -> Array[response]
|
57
51
|
end
|
58
52
|
end
|
data/sig/timers.rbs
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
module HTTPX
|
2
|
+
class Timers
|
3
|
+
@interval: Array[Interval]
|
4
|
+
|
5
|
+
def after: (Numeric interval_in_secs) { () -> void } -> void
|
6
|
+
|
7
|
+
def wait_interval: () -> Numeric?
|
8
|
+
|
9
|
+
def fire: (?StandardError error) -> void
|
10
|
+
|
11
|
+
def cancel: () -> void
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def initialize: () -> void
|
16
|
+
|
17
|
+
class Interval
|
18
|
+
include Comparable
|
19
|
+
|
20
|
+
attr_reader interval: Numeric
|
21
|
+
|
22
|
+
def to_f: () -> Float
|
23
|
+
|
24
|
+
def <<: (^() -> void) -> void
|
25
|
+
|
26
|
+
def elapse: (Numeric elapsed) -> Numeric
|
27
|
+
private
|
28
|
+
|
29
|
+
def initialize: (Numeric interval) -> void
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/sig/transcoder/form.rbs
CHANGED
data/sig/transcoder/json.rbs
CHANGED
data/sig/transcoder.rbs
CHANGED
@@ -6,9 +6,10 @@ module HTTPX
|
|
6
6
|
| () -> Hash[String, _Encode]
|
7
7
|
|
8
8
|
def self?.register: (String tag, _Encode handler) -> void
|
9
|
-
|
10
|
-
def self?.normalize_keys: (_ToS key, _ToAry[untyped] | _ToHash[_ToS, untyped] | untyped value) { (String, ?untyped) ->
|
11
|
-
|
9
|
+
|
10
|
+
def self?.normalize_keys: [U] (_ToS key, _ToAry[untyped] | _ToHash[_ToS, untyped] | untyped value, ?(^(untyped value) -> bool | nil) cond) { (String, ?untyped) -> U } -> U
|
11
|
+
|
12
|
+
def self?.normalize_query: (Hash[String, untyped] params, String name, String v, Integer depth) -> void
|
12
13
|
|
13
14
|
interface _Encode
|
14
15
|
def encode: (untyped payload) -> (_Encoder | _Each[String])
|
@@ -19,7 +20,7 @@ module HTTPX
|
|
19
20
|
end
|
20
21
|
|
21
22
|
interface _Decoder
|
22
|
-
def
|
23
|
+
def call: (Response response, untyped options) -> untyped
|
23
24
|
end
|
24
25
|
end
|
25
26
|
end
|
data/sig/utils.rbs
CHANGED
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.
|
4
|
+
version: 0.18.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tiago Cardoso
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http-2-next
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.4.1
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: timers
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
27
|
description: A client library for making HTTP requests from Ruby.
|
42
28
|
email:
|
43
29
|
- cardoso_tiago@hotmail.com
|
@@ -75,6 +61,10 @@ extra_rdoc_files:
|
|
75
61
|
- doc/release_notes/0_15_4.md
|
76
62
|
- doc/release_notes/0_16_0.md
|
77
63
|
- doc/release_notes/0_16_1.md
|
64
|
+
- doc/release_notes/0_17_0.md
|
65
|
+
- doc/release_notes/0_18_0.md
|
66
|
+
- doc/release_notes/0_18_1.md
|
67
|
+
- doc/release_notes/0_18_2.md
|
78
68
|
- doc/release_notes/0_1_0.md
|
79
69
|
- doc/release_notes/0_2_0.md
|
80
70
|
- doc/release_notes/0_2_1.md
|
@@ -129,6 +119,10 @@ files:
|
|
129
119
|
- doc/release_notes/0_15_4.md
|
130
120
|
- doc/release_notes/0_16_0.md
|
131
121
|
- doc/release_notes/0_16_1.md
|
122
|
+
- doc/release_notes/0_17_0.md
|
123
|
+
- doc/release_notes/0_18_0.md
|
124
|
+
- doc/release_notes/0_18_1.md
|
125
|
+
- doc/release_notes/0_18_2.md
|
132
126
|
- doc/release_notes/0_1_0.md
|
133
127
|
- doc/release_notes/0_2_0.md
|
134
128
|
- doc/release_notes/0_2_1.md
|
@@ -199,6 +193,7 @@ files:
|
|
199
193
|
- lib/httpx/plugins/h2c.rb
|
200
194
|
- lib/httpx/plugins/internal_telemetry.rb
|
201
195
|
- lib/httpx/plugins/multipart.rb
|
196
|
+
- lib/httpx/plugins/multipart/decoder.rb
|
202
197
|
- lib/httpx/plugins/multipart/encoder.rb
|
203
198
|
- lib/httpx/plugins/multipart/mime_type_detector.rb
|
204
199
|
- lib/httpx/plugins/multipart/part.rb
|
@@ -211,6 +206,8 @@ files:
|
|
211
206
|
- lib/httpx/plugins/proxy/ssh.rb
|
212
207
|
- lib/httpx/plugins/push_promise.rb
|
213
208
|
- lib/httpx/plugins/rate_limiter.rb
|
209
|
+
- lib/httpx/plugins/response_cache.rb
|
210
|
+
- lib/httpx/plugins/response_cache/store.rb
|
214
211
|
- lib/httpx/plugins/retries.rb
|
215
212
|
- lib/httpx/plugins/stream.rb
|
216
213
|
- lib/httpx/plugins/upgrade.rb
|
@@ -229,6 +226,7 @@ files:
|
|
229
226
|
- lib/httpx/selector.rb
|
230
227
|
- lib/httpx/session.rb
|
231
228
|
- lib/httpx/session2.rb
|
229
|
+
- lib/httpx/timers.rb
|
232
230
|
- lib/httpx/transcoder.rb
|
233
231
|
- lib/httpx/transcoder/body.rb
|
234
232
|
- lib/httpx/transcoder/chunker.rb
|
@@ -275,6 +273,7 @@ files:
|
|
275
273
|
- sig/plugins/proxy/ssh.rbs
|
276
274
|
- sig/plugins/push_promise.rbs
|
277
275
|
- sig/plugins/rate_limiter.rbs
|
276
|
+
- sig/plugins/response_cache.rbs
|
278
277
|
- sig/plugins/retries.rbs
|
279
278
|
- sig/plugins/stream.rbs
|
280
279
|
- sig/plugins/upgrade.rbs
|
@@ -289,6 +288,7 @@ files:
|
|
289
288
|
- sig/response.rbs
|
290
289
|
- sig/selector.rbs
|
291
290
|
- sig/session.rbs
|
291
|
+
- sig/timers.rbs
|
292
292
|
- sig/transcoder.rbs
|
293
293
|
- sig/transcoder/body.rbs
|
294
294
|
- sig/transcoder/chunker.rbs
|
@@ -304,6 +304,7 @@ metadata:
|
|
304
304
|
documentation_uri: https://honeyryderchuck.gitlab.io/httpx/rdoc/
|
305
305
|
source_code_uri: https://gitlab.com/honeyryderchuck/httpx
|
306
306
|
homepage_uri: https://honeyryderchuck.gitlab.io/httpx/
|
307
|
+
rubygems_mfa_required: 'true'
|
307
308
|
post_install_message:
|
308
309
|
rdoc_options: []
|
309
310
|
require_paths:
|
@@ -319,7 +320,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
319
320
|
- !ruby/object:Gem::Version
|
320
321
|
version: '0'
|
321
322
|
requirements: []
|
322
|
-
rubygems_version: 3.2.
|
323
|
+
rubygems_version: 3.2.22
|
323
324
|
signing_key:
|
324
325
|
specification_version: 4
|
325
326
|
summary: HTTPX, to the future, and beyond
|