httpx 0.16.1 → 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_17_0.md +49 -0
- data/lib/httpx/adapters/webmock.rb +2 -2
- data/lib/httpx/chainable.rb +1 -1
- data/lib/httpx/connection/http1.rb +15 -9
- data/lib/httpx/connection/http2.rb +13 -10
- data/lib/httpx/connection.rb +4 -5
- data/lib/httpx/headers.rb +1 -1
- data/lib/httpx/options.rb +28 -6
- data/lib/httpx/parser/http1.rb +10 -6
- data/lib/httpx/plugins/digest_authentication.rb +4 -4
- 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 +4 -4
- data/lib/httpx/plugins/proxy/ssh.rb +11 -4
- data/lib/httpx/plugins/proxy.rb +6 -4
- data/lib/httpx/plugins/stream.rb +2 -3
- data/lib/httpx/registry.rb +1 -1
- data/lib/httpx/request.rb +6 -7
- data/lib/httpx/resolver/resolver_mixin.rb +2 -1
- data/lib/httpx/response.rb +37 -30
- data/lib/httpx/selector.rb +4 -2
- data/lib/httpx/session.rb +15 -13
- 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/sig/buffer.rbs +2 -2
- data/sig/chainable.rbs +6 -1
- data/sig/connection/http1.rbs +10 -4
- data/sig/connection/http2.rbs +16 -5
- data/sig/connection.rbs +4 -4
- data/sig/headers.rbs +19 -18
- data/sig/options.rbs +13 -5
- data/sig/parser/http1.rbs +3 -3
- 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/request.rbs +11 -8
- data/sig/resolver/native.rbs +4 -2
- data/sig/resolver/resolver_mixin.rbs +1 -1
- data/sig/resolver/system.rbs +1 -1
- data/sig/response.rbs +8 -2
- data/sig/selector.rbs +8 -6
- data/sig/session.rbs +8 -14
- data/sig/transcoder/form.rbs +1 -0
- data/sig/transcoder/json.rbs +1 -0
- data/sig/transcoder.rbs +5 -4
- metadata +5 -2
data/sig/resolver/native.rbs
CHANGED
@@ -5,6 +5,8 @@ module HTTPX
|
|
5
5
|
include ResolverMixin
|
6
6
|
include _ToIO
|
7
7
|
|
8
|
+
type state = :idle | :open | :closed
|
9
|
+
|
8
10
|
DEFAULTS: Hash[Symbol, untyped]
|
9
11
|
DNS_PORT: Integer
|
10
12
|
|
@@ -19,7 +21,7 @@ module HTTPX
|
|
19
21
|
@queries: Hash[String, Connection]
|
20
22
|
@read_buffer: String
|
21
23
|
@write_buffer: Buffer
|
22
|
-
@state:
|
24
|
+
@state: state
|
23
25
|
|
24
26
|
def closed?: () -> bool
|
25
27
|
|
@@ -56,7 +58,7 @@ module HTTPX
|
|
56
58
|
|
57
59
|
def build_socket: () -> void
|
58
60
|
|
59
|
-
def transition: (
|
61
|
+
def transition: (state nextstate) -> void
|
60
62
|
|
61
63
|
def handle_error: (NativeResolveError | StandardError) -> void
|
62
64
|
end
|
data/sig/resolver/system.rbs
CHANGED
data/sig/response.rbs
CHANGED
@@ -22,16 +22,22 @@ module HTTPX
|
|
22
22
|
def close: () -> void
|
23
23
|
def uri: () -> URI::Generic
|
24
24
|
|
25
|
-
def merge_headers: (_Each[[
|
25
|
+
def merge_headers: (_Each[[String, headers_value]]) -> void
|
26
26
|
def bodyless?: () -> bool
|
27
27
|
def content_type: () -> ContentType
|
28
28
|
def complete?: () -> bool
|
29
29
|
|
30
|
+
def json: (?json_options opts) -> untyped
|
31
|
+
|
32
|
+
def form: () -> Hash[String, untyped]
|
33
|
+
|
30
34
|
private
|
31
35
|
|
32
36
|
def initialize: (Request request, String | Integer status, String version, headers?) -> untyped
|
33
37
|
def no_data?: () -> bool
|
34
38
|
|
39
|
+
def decode:(String format, ?untyped options) -> untyped
|
40
|
+
|
35
41
|
class Body
|
36
42
|
include _Reader
|
37
43
|
include _ToS
|
@@ -73,7 +79,7 @@ module HTTPX
|
|
73
79
|
|
74
80
|
private
|
75
81
|
|
76
|
-
def initialize: (String
|
82
|
+
def initialize: (String? header_value) -> void
|
77
83
|
end
|
78
84
|
|
79
85
|
class ErrorResponse
|
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/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
|
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-08-
|
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
|
@@ -75,6 +75,7 @@ extra_rdoc_files:
|
|
75
75
|
- doc/release_notes/0_15_4.md
|
76
76
|
- doc/release_notes/0_16_0.md
|
77
77
|
- doc/release_notes/0_16_1.md
|
78
|
+
- doc/release_notes/0_17_0.md
|
78
79
|
- doc/release_notes/0_1_0.md
|
79
80
|
- doc/release_notes/0_2_0.md
|
80
81
|
- doc/release_notes/0_2_1.md
|
@@ -129,6 +130,7 @@ files:
|
|
129
130
|
- doc/release_notes/0_15_4.md
|
130
131
|
- doc/release_notes/0_16_0.md
|
131
132
|
- doc/release_notes/0_16_1.md
|
133
|
+
- doc/release_notes/0_17_0.md
|
132
134
|
- doc/release_notes/0_1_0.md
|
133
135
|
- doc/release_notes/0_2_0.md
|
134
136
|
- doc/release_notes/0_2_1.md
|
@@ -199,6 +201,7 @@ files:
|
|
199
201
|
- lib/httpx/plugins/h2c.rb
|
200
202
|
- lib/httpx/plugins/internal_telemetry.rb
|
201
203
|
- lib/httpx/plugins/multipart.rb
|
204
|
+
- lib/httpx/plugins/multipart/decoder.rb
|
202
205
|
- lib/httpx/plugins/multipart/encoder.rb
|
203
206
|
- lib/httpx/plugins/multipart/mime_type_detector.rb
|
204
207
|
- lib/httpx/plugins/multipart/part.rb
|