httpx 0.15.3 → 0.17.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_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/lib/httpx/adapters/faraday.rb +3 -11
- data/lib/httpx/adapters/webmock.rb +2 -2
- 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/http1.rb +18 -10
- data/lib/httpx/connection/http2.rb +14 -21
- data/lib/httpx/connection.rb +6 -7
- data/lib/httpx/errors.rb +11 -11
- data/lib/httpx/headers.rb +1 -1
- data/lib/httpx/io/ssl.rb +2 -2
- data/lib/httpx/io/tls.rb +1 -1
- data/lib/httpx/options.rb +108 -81
- data/lib/httpx/parser/http1.rb +11 -7
- data/lib/httpx/plugins/aws_sigv4.rb +10 -9
- data/lib/httpx/plugins/compression.rb +12 -11
- data/lib/httpx/plugins/cookies/cookie.rb +4 -2
- data/lib/httpx/plugins/cookies/jar.rb +20 -1
- data/lib/httpx/plugins/cookies.rb +20 -7
- data/lib/httpx/plugins/digest_authentication.rb +19 -15
- data/lib/httpx/plugins/expect.rb +19 -15
- data/lib/httpx/plugins/follow_redirects.rb +9 -9
- data/lib/httpx/plugins/grpc/call.rb +4 -1
- data/lib/httpx/plugins/grpc.rb +73 -47
- data/lib/httpx/plugins/h2c.rb +7 -3
- 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 +14 -0
- data/lib/httpx/plugins/ntlm_authentication.rb +12 -10
- 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 +20 -13
- data/lib/httpx/plugins/proxy.rb +10 -10
- data/lib/httpx/plugins/retries.rb +25 -21
- data/lib/httpx/plugins/stream.rb +2 -3
- data/lib/httpx/plugins/upgrade.rb +7 -6
- data/lib/httpx/registry.rb +2 -2
- data/lib/httpx/request.rb +10 -19
- data/lib/httpx/resolver/https.rb +0 -2
- data/lib/httpx/resolver/native.rb +15 -3
- data/lib/httpx/resolver/resolver_mixin.rb +2 -1
- data/lib/httpx/response.rb +72 -38
- data/lib/httpx/selector.rb +6 -7
- data/lib/httpx/session.rb +34 -21
- data/lib/httpx/session2.rb +23 -0
- data/lib/httpx/transcoder/body.rb +1 -1
- data/lib/httpx/transcoder/chunker.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 +2 -2
- data/lib/httpx/version.rb +1 -1
- data/lib/httpx.rb +6 -3
- data/sig/buffer.rbs +3 -1
- data/sig/chainable.rbs +30 -29
- data/sig/connection/http1.rbs +11 -5
- data/sig/connection/http2.rbs +16 -5
- data/sig/connection.rbs +23 -11
- data/sig/errors.rbs +35 -1
- data/sig/headers.rbs +20 -19
- data/sig/httpx.rbs +4 -1
- data/sig/loggable.rbs +3 -1
- data/sig/options.rbs +45 -34
- data/sig/parser/http1.rbs +3 -3
- data/sig/plugins/authentication.rbs +1 -1
- data/sig/plugins/aws_sdk_authentication.rbs +5 -1
- data/sig/plugins/aws_sigv4.rbs +13 -5
- data/sig/plugins/basic_authentication.rbs +1 -1
- data/sig/plugins/compression.rbs +4 -6
- data/sig/plugins/cookies/cookie.rbs +5 -7
- data/sig/plugins/cookies/jar.rbs +9 -10
- data/sig/plugins/cookies.rbs +4 -5
- 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 +64 -10
- data/sig/plugins/ntlm_authentication.rbs +2 -3
- data/sig/plugins/persistent.rbs +3 -8
- data/sig/plugins/proxy/ssh.rbs +4 -4
- data/sig/plugins/proxy.rbs +13 -13
- 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 +11 -8
- data/sig/resolver/native.rbs +12 -6
- data/sig/resolver/resolver_mixin.rbs +4 -5
- data/sig/resolver/system.rbs +2 -0
- data/sig/resolver.rbs +7 -0
- data/sig/response.rbs +24 -12
- data/sig/selector.rbs +11 -9
- data/sig/session.rbs +22 -23
- data/sig/transcoder/body.rbs +6 -1
- data/sig/transcoder/chunker.rbs +8 -2
- data/sig/transcoder/form.rbs +3 -1
- data/sig/transcoder/json.rbs +2 -0
- data/sig/transcoder.rbs +13 -5
- data/sig/utils.rbs +2 -0
- metadata +12 -2
data/sig/selector.rbs
CHANGED
@@ -1,20 +1,22 @@
|
|
1
1
|
module HTTPX
|
2
2
|
class Selector
|
3
|
-
|
4
|
-
WRITABLE: :w | :rw
|
5
|
-
@selectables: Array[_ToIO]
|
3
|
+
type selectable = Connection | Resolver::Native | Resolver::HTTPS
|
6
4
|
|
7
|
-
|
8
|
-
|
5
|
+
READABLE: Array[Symbol]
|
6
|
+
WRITABLE: Array[Symbol]
|
7
|
+
@selectables: Array[selectable]
|
8
|
+
|
9
|
+
def register: (selectable) -> void
|
10
|
+
def deregister: (selectable) -> void
|
11
|
+
|
12
|
+
def select: (Numeric? interval) { (selectable) -> void } -> void
|
9
13
|
|
10
|
-
def select: (Numeric?) { (_ToIO) -> void } -> void
|
11
|
-
|
12
14
|
private
|
13
15
|
|
14
16
|
def initialize: () -> untyped
|
15
17
|
|
16
|
-
def select_many: (Numeric?) { (
|
17
|
-
def select_one: (Numeric?) { (
|
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
@@ -3,51 +3,50 @@ module HTTPX
|
|
3
3
|
include Loggable
|
4
4
|
include Chainable
|
5
5
|
|
6
|
-
|
7
|
-
@responses: Hash[Request, Response]
|
8
|
-
@persistent: bool
|
9
|
-
|
10
|
-
def wrap: () { (instance) -> void } -> void
|
11
|
-
| () -> void
|
12
|
-
def close: (*untyped) -> void
|
6
|
+
EMPTY_HASH: Hash[untyped, untyped]
|
13
7
|
|
14
|
-
|
15
|
-
|
8
|
+
@options: Options
|
9
|
+
@responses: Hash[Request, response]
|
10
|
+
@persistent: bool?
|
16
11
|
|
17
|
-
def
|
12
|
+
def self.plugin: (Symbol | Module plugin, ?options? options) ?{ (Class) -> void } -> singleton(Session)
|
18
13
|
|
19
|
-
def self.
|
20
|
-
| (Symbol | Module, ?options) -> singleton(Session)
|
14
|
+
def self.default_options: -> Options
|
21
15
|
|
16
|
+
def wrap: () { (instance) -> void } -> void
|
22
17
|
|
18
|
+
def close: (*untyped) -> void
|
23
19
|
|
24
|
-
def
|
20
|
+
def build_request: (String | verb, generic_uri, ?options) -> Request
|
25
21
|
|
26
22
|
private
|
27
23
|
|
28
|
-
def initialize: (?options
|
29
|
-
| (?options
|
24
|
+
def initialize: (?options) { (self) -> void } -> untyped
|
25
|
+
| (?options) -> untyped
|
30
26
|
|
31
27
|
def pool: -> Pool
|
32
28
|
def on_response: (Request, response) -> void
|
33
29
|
def on_promise: (untyped, untyped) -> void
|
34
|
-
def fetch_response: (Request,
|
30
|
+
def fetch_response: (Request request, untyped, untyped) -> response?
|
31
|
+
|
32
|
+
def find_connection: (Request, Array[Connection] connections, Options options) -> Connection
|
33
|
+
|
35
34
|
def set_connection_callbacks: (Connection, Array[Connection], Options) -> void
|
36
35
|
|
37
|
-
def build_altsvc_connection: (Connection, Array[Connection], URI, String, Hash[String, String], Options) -> Connection?
|
36
|
+
def build_altsvc_connection: (Connection, Array[Connection], URI::Generic, String, Hash[String, String], Options) -> Connection?
|
38
37
|
|
39
38
|
def build_requests: (verb | string, uri, options) -> Array[Request]
|
40
39
|
| (Array[[verb | string, uri, options]], options) -> Array[Request]
|
41
40
|
| (Array[[verb | string, uri]], options) -> Array[Request]
|
42
|
-
| (verb | string, _Each[[uri, options]
|
43
|
-
| (verb | string, _Each[uri
|
41
|
+
| (verb | string, _Each[[uri, options]], Options) -> Array[Request]
|
42
|
+
| (verb | string, _Each[uri], options) -> Array[Request]
|
44
43
|
|
45
|
-
def build_connection: (URI, Options) -> Connection
|
44
|
+
def build_connection: (URI::Generic, Options) -> Connection
|
46
45
|
|
47
|
-
def send_requests: (*Request
|
46
|
+
def send_requests: (*Request) -> Array[response]
|
48
47
|
|
49
|
-
def _send_requests: (Array[Request]
|
48
|
+
def _send_requests: (Array[Request]) -> Array[Connection]
|
50
49
|
|
51
|
-
def receive_requests: (Array[Request], Array[Connection]
|
50
|
+
def receive_requests: (Array[Request], Array[Connection]) -> Array[response]
|
52
51
|
end
|
53
52
|
end
|
data/sig/transcoder/body.rbs
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
module HTTPX
|
2
2
|
module Transcoder
|
3
3
|
module Body
|
4
|
+
class Error < HTTPX::Error
|
5
|
+
end
|
6
|
+
|
4
7
|
class Encoder
|
8
|
+
extend Forwardable
|
9
|
+
|
5
10
|
include _Encoder
|
6
11
|
include _ToS
|
7
12
|
|
@@ -11,7 +16,7 @@ module HTTPX
|
|
11
16
|
|
12
17
|
private
|
13
18
|
|
14
|
-
def initialize: (untyped body
|
19
|
+
def initialize: (untyped body) -> untyped
|
15
20
|
end
|
16
21
|
|
17
22
|
def self?.encode: (bodyIO body) -> Encoder
|
data/sig/transcoder/chunker.rbs
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
module HTTPX::Transcoder
|
2
2
|
module Chunker
|
3
|
-
|
3
|
+
CRLF: String
|
4
|
+
|
5
|
+
class Error < HTTPX::Error
|
6
|
+
end
|
7
|
+
|
8
|
+
def self?.encode: (_Each[String] chunks) -> Encoder
|
4
9
|
|
5
10
|
class Encoder
|
6
11
|
@raw: _Each[String]
|
@@ -9,10 +14,11 @@ module HTTPX::Transcoder
|
|
9
14
|
|
10
15
|
private
|
11
16
|
|
12
|
-
def initialize: (
|
17
|
+
def initialize: (_Each[String] chunks) -> untyped
|
13
18
|
end
|
14
19
|
|
15
20
|
class Decoder
|
21
|
+
extend Forwardable
|
16
22
|
include _ToS
|
17
23
|
include _Each[String]
|
18
24
|
|
data/sig/transcoder/form.rbs
CHANGED
@@ -3,12 +3,14 @@ module HTTPX::Transcoder
|
|
3
3
|
|
4
4
|
type form_nested_value = form_value | _ToAry[form_value] | _ToHash[string, form_value]
|
5
5
|
|
6
|
-
type urlencoded_input = Enumerable[[
|
6
|
+
type urlencoded_input = Enumerable[[_ToS, form_nested_value]]
|
7
7
|
|
8
8
|
module Form
|
9
9
|
def self?.encode: (urlencoded_input form) -> Encoder
|
10
|
+
def self?.decode: (HTTPX::Response response) -> _Decoder
|
10
11
|
|
11
12
|
class Encoder
|
13
|
+
extend Forwardable
|
12
14
|
include _Encoder
|
13
15
|
include _ToS
|
14
16
|
|
data/sig/transcoder/json.rbs
CHANGED
data/sig/transcoder.rbs
CHANGED
@@ -1,18 +1,26 @@
|
|
1
1
|
module HTTPX
|
2
|
-
type bodyIO = _Reader | _Each[String, untyped] | _ToS
|
2
|
+
type bodyIO = _Reader | _Each[[String, untyped]] | _ToS
|
3
3
|
|
4
4
|
module Transcoder
|
5
|
-
|
5
|
+
def self?.registry: (String tag) -> _Encode
|
6
|
+
| () -> Hash[String, _Encode]
|
6
7
|
|
7
|
-
def self
|
8
|
-
|
8
|
+
def self?.register: (String tag, _Encode handler) -> void
|
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
|
13
|
+
|
14
|
+
interface _Encode
|
15
|
+
def encode: (untyped payload) -> (_Encoder | _Each[String])
|
16
|
+
end
|
9
17
|
|
10
18
|
interface _Encoder
|
11
19
|
def bytesize: () -> Numeric
|
12
20
|
end
|
13
21
|
|
14
22
|
interface _Decoder
|
15
|
-
def
|
23
|
+
def call: (Response response, untyped options) -> untyped
|
16
24
|
end
|
17
25
|
end
|
18
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.17.0
|
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-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http-2-next
|
@@ -72,6 +72,10 @@ extra_rdoc_files:
|
|
72
72
|
- doc/release_notes/0_15_1.md
|
73
73
|
- doc/release_notes/0_15_2.md
|
74
74
|
- doc/release_notes/0_15_3.md
|
75
|
+
- doc/release_notes/0_15_4.md
|
76
|
+
- doc/release_notes/0_16_0.md
|
77
|
+
- doc/release_notes/0_16_1.md
|
78
|
+
- doc/release_notes/0_17_0.md
|
75
79
|
- doc/release_notes/0_1_0.md
|
76
80
|
- doc/release_notes/0_2_0.md
|
77
81
|
- doc/release_notes/0_2_1.md
|
@@ -123,6 +127,10 @@ files:
|
|
123
127
|
- doc/release_notes/0_15_1.md
|
124
128
|
- doc/release_notes/0_15_2.md
|
125
129
|
- doc/release_notes/0_15_3.md
|
130
|
+
- doc/release_notes/0_15_4.md
|
131
|
+
- doc/release_notes/0_16_0.md
|
132
|
+
- doc/release_notes/0_16_1.md
|
133
|
+
- doc/release_notes/0_17_0.md
|
126
134
|
- doc/release_notes/0_1_0.md
|
127
135
|
- doc/release_notes/0_2_0.md
|
128
136
|
- doc/release_notes/0_2_1.md
|
@@ -193,6 +201,7 @@ files:
|
|
193
201
|
- lib/httpx/plugins/h2c.rb
|
194
202
|
- lib/httpx/plugins/internal_telemetry.rb
|
195
203
|
- lib/httpx/plugins/multipart.rb
|
204
|
+
- lib/httpx/plugins/multipart/decoder.rb
|
196
205
|
- lib/httpx/plugins/multipart/encoder.rb
|
197
206
|
- lib/httpx/plugins/multipart/mime_type_detector.rb
|
198
207
|
- lib/httpx/plugins/multipart/part.rb
|
@@ -222,6 +231,7 @@ files:
|
|
222
231
|
- lib/httpx/response.rb
|
223
232
|
- lib/httpx/selector.rb
|
224
233
|
- lib/httpx/session.rb
|
234
|
+
- lib/httpx/session2.rb
|
225
235
|
- lib/httpx/transcoder.rb
|
226
236
|
- lib/httpx/transcoder/body.rb
|
227
237
|
- lib/httpx/transcoder/chunker.rb
|