httpx 0.10.1 → 0.11.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -3
  3. data/doc/release_notes/0_10_1.md +1 -3
  4. data/doc/release_notes/0_10_2.md +5 -0
  5. data/doc/release_notes/0_11_0.md +76 -0
  6. data/doc/release_notes/0_11_1.md +1 -0
  7. data/doc/release_notes/0_11_2.md +5 -0
  8. data/doc/release_notes/0_11_3.md +5 -0
  9. data/lib/httpx/adapters/datadog.rb +205 -0
  10. data/lib/httpx/adapters/faraday.rb +0 -2
  11. data/lib/httpx/adapters/webmock.rb +123 -0
  12. data/lib/httpx/chainable.rb +1 -1
  13. data/lib/httpx/connection/http1.rb +10 -0
  14. data/lib/httpx/connection/http2.rb +4 -4
  15. data/lib/httpx/domain_name.rb +1 -3
  16. data/lib/httpx/errors.rb +2 -0
  17. data/lib/httpx/headers.rb +1 -0
  18. data/lib/httpx/io/ssl.rb +4 -8
  19. data/lib/httpx/io/udp.rb +4 -3
  20. data/lib/httpx/plugins/compression.rb +1 -1
  21. data/lib/httpx/plugins/cookies/set_cookie_parser.rb +1 -1
  22. data/lib/httpx/plugins/expect.rb +33 -8
  23. data/lib/httpx/plugins/multipart.rb +40 -35
  24. data/lib/httpx/plugins/multipart/encoder.rb +115 -0
  25. data/lib/httpx/plugins/multipart/mime_type_detector.rb +64 -0
  26. data/lib/httpx/plugins/multipart/part.rb +34 -0
  27. data/lib/httpx/plugins/proxy/socks5.rb +3 -2
  28. data/lib/httpx/plugins/push_promise.rb +2 -2
  29. data/lib/httpx/request.rb +21 -11
  30. data/lib/httpx/resolver.rb +7 -4
  31. data/lib/httpx/resolver/https.rb +4 -2
  32. data/lib/httpx/resolver/native.rb +10 -6
  33. data/lib/httpx/resolver/system.rb +1 -1
  34. data/lib/httpx/selector.rb +1 -0
  35. data/lib/httpx/session.rb +15 -18
  36. data/lib/httpx/transcoder.rb +6 -4
  37. data/lib/httpx/version.rb +1 -1
  38. data/sig/connection/http2.rbs +3 -4
  39. data/sig/headers.rbs +3 -0
  40. data/sig/plugins/multipart.rbs +27 -4
  41. data/sig/request.rbs +1 -1
  42. data/sig/resolver/https.rbs +2 -0
  43. data/sig/response.rbs +1 -1
  44. data/sig/session.rbs +1 -1
  45. data/sig/transcoder.rbs +2 -2
  46. data/sig/transcoder/body.rbs +2 -0
  47. data/sig/transcoder/form.rbs +7 -1
  48. data/sig/transcoder/json.rbs +3 -1
  49. metadata +40 -46
  50. data/sig/missing.rbs +0 -12
data/sig/request.rbs CHANGED
@@ -37,7 +37,7 @@ module HTTPX
37
37
 
38
38
  def transition: (Symbol) -> void
39
39
 
40
- def expects?: () -> bool
40
+ def expects?: () -> boolish
41
41
 
42
42
  class Body
43
43
  def initialize: (Headers, Options) -> untyped
@@ -39,6 +39,8 @@ module HTTPX
39
39
  | (Connection) -> void
40
40
  | () -> void
41
41
 
42
+ def on_response: (Request, response) -> void
43
+
42
44
  def response: (Response) -> void
43
45
 
44
46
  def build_request: (String hostname, "A" | "AAAA") -> Request
data/sig/response.rbs CHANGED
@@ -27,7 +27,7 @@ module HTTPX
27
27
 
28
28
  private
29
29
 
30
- def initialize: (Request, _ToS, String, headers) -> untyped
30
+ def initialize: (Request, _ToS, String, headers?) -> untyped
31
31
  def no_data?: () -> bool
32
32
 
33
33
  class Body
data/sig/session.rbs CHANGED
@@ -29,7 +29,7 @@ module HTTPX
29
29
  | (?options?) -> untyped
30
30
 
31
31
  def pool: -> Pool
32
- # def on_response: (Request, response) -> void
32
+ def on_response: (Request, response) -> void
33
33
  def on_promise: (untyped, untyped) -> void
34
34
  def fetch_response: (Request, *untyped) -> response?
35
35
  def set_connection_callbacks: (Connection, Array[Connection], Options) -> void
data/sig/transcoder.rbs CHANGED
@@ -4,8 +4,8 @@ module HTTPX
4
4
  module Transcoder
5
5
  extend HTTPX::Registry[String, Class]
6
6
 
7
- def self.normalize_keys: (string | Symbol, top) { (string, top) -> void } -> void
8
- | (string | Symbol, top) { (string) -> void } -> void
7
+ def self.normalize_keys: (string | Symbol, top, ?Proc?) { (string, top) -> void } -> void
8
+ | (string | Symbol, top, ?Proc?) { (string) -> void } -> void
9
9
 
10
10
  interface _Encoder
11
11
  def bytesize: () -> Numeric
@@ -7,6 +7,8 @@ module HTTPX
7
7
 
8
8
  @raw: bodyIO
9
9
 
10
+ def content_type: () -> String
11
+
10
12
  private
11
13
 
12
14
  def initialize: (untyped body ) -> untyped
@@ -1,5 +1,9 @@
1
1
  module HTTPX::Transcoder
2
- type urlencoded_input = Enumerable[[string, string], untyped]
2
+ type form_value = string
3
+
4
+ type form_nested_value = form_value | _ToAry[form_value] | _ToHash[string, form_value]
5
+
6
+ type urlencoded_input = Enumerable[[string, form_nested_value], untyped]
3
7
 
4
8
  module Form
5
9
  def self?.encode: (urlencoded_input form) -> Encoder
@@ -8,6 +12,8 @@ module HTTPX::Transcoder
8
12
  include _Encoder
9
13
  include _ToS
10
14
 
15
+ def content_type: () -> String
16
+
11
17
  private
12
18
 
13
19
  def initialize: (urlencoded_input form) -> untyped
@@ -6,9 +6,11 @@ module HTTPX::Transcoder
6
6
  include _Encoder
7
7
  include _ToS
8
8
 
9
+ def content_type: () -> String
10
+
9
11
  private
10
12
 
11
- def initalize: (_ToJson json) -> untyped
13
+ def initialize: (_ToJson json) -> untyped
12
14
  end
13
15
  end
14
16
  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.10.1
4
+ version: 0.11.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiago Cardoso
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-10 00:00:00.000000000 Z
11
+ date: 2021-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http-2-next
@@ -38,26 +38,6 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: http-form_data
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: 2.0.0
48
- - - "<"
49
- - !ruby/object:Gem::Version
50
- version: '3'
51
- type: :development
52
- prerelease: false
53
- version_requirements: !ruby/object:Gem::Requirement
54
- requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- version: 2.0.0
58
- - - "<"
59
- - !ruby/object:Gem::Version
60
- version: '3'
61
41
  description: A client library for making HTTP requests from Ruby.
62
42
  email:
63
43
  - cardoso_tiago@hotmail.com
@@ -67,34 +47,39 @@ extra_rdoc_files:
67
47
  - LICENSE.txt
68
48
  - README.md
69
49
  - doc/release_notes/0_0_1.md
70
- - doc/release_notes/0_1_0.md
71
- - doc/release_notes/0_0_5.md
50
+ - doc/release_notes/0_0_2.md
51
+ - doc/release_notes/0_0_3.md
72
52
  - doc/release_notes/0_0_4.md
73
- - doc/release_notes/0_6_5.md
74
- - doc/release_notes/0_6_1.md
75
- - doc/release_notes/0_7_0.md
76
- - doc/release_notes/0_6_0.md
77
- - doc/release_notes/0_8_2.md
78
- - doc/release_notes/0_6_4.md
79
- - doc/release_notes/0_9_0.md
80
- - doc/release_notes/0_6_3.md
53
+ - doc/release_notes/0_0_5.md
54
+ - doc/release_notes/0_10_0.md
81
55
  - doc/release_notes/0_10_1.md
82
- - doc/release_notes/0_8_1.md
83
- - doc/release_notes/0_5_0.md
84
- - doc/release_notes/0_6_7.md
56
+ - doc/release_notes/0_10_2.md
57
+ - doc/release_notes/0_11_0.md
58
+ - doc/release_notes/0_11_1.md
59
+ - doc/release_notes/0_11_2.md
60
+ - doc/release_notes/0_11_3.md
61
+ - doc/release_notes/0_1_0.md
62
+ - doc/release_notes/0_2_0.md
63
+ - doc/release_notes/0_2_1.md
64
+ - doc/release_notes/0_3_0.md
65
+ - doc/release_notes/0_3_1.md
66
+ - doc/release_notes/0_4_0.md
85
67
  - doc/release_notes/0_4_1.md
68
+ - doc/release_notes/0_5_0.md
86
69
  - doc/release_notes/0_5_1.md
87
- - doc/release_notes/0_6_6.md
88
- - doc/release_notes/0_4_0.md
70
+ - doc/release_notes/0_6_0.md
71
+ - doc/release_notes/0_6_1.md
89
72
  - doc/release_notes/0_6_2.md
90
- - doc/release_notes/0_10_0.md
73
+ - doc/release_notes/0_6_3.md
74
+ - doc/release_notes/0_6_4.md
75
+ - doc/release_notes/0_6_5.md
76
+ - doc/release_notes/0_6_6.md
77
+ - doc/release_notes/0_6_7.md
78
+ - doc/release_notes/0_7_0.md
91
79
  - doc/release_notes/0_8_0.md
92
- - doc/release_notes/0_3_0.md
93
- - doc/release_notes/0_2_1.md
94
- - doc/release_notes/0_0_3.md
95
- - doc/release_notes/0_0_2.md
96
- - doc/release_notes/0_3_1.md
97
- - doc/release_notes/0_2_0.md
80
+ - doc/release_notes/0_8_1.md
81
+ - doc/release_notes/0_8_2.md
82
+ - doc/release_notes/0_9_0.md
98
83
  files:
99
84
  - LICENSE.txt
100
85
  - README.md
@@ -105,6 +90,11 @@ files:
105
90
  - doc/release_notes/0_0_5.md
106
91
  - doc/release_notes/0_10_0.md
107
92
  - doc/release_notes/0_10_1.md
93
+ - doc/release_notes/0_10_2.md
94
+ - doc/release_notes/0_11_0.md
95
+ - doc/release_notes/0_11_1.md
96
+ - doc/release_notes/0_11_2.md
97
+ - doc/release_notes/0_11_3.md
108
98
  - doc/release_notes/0_1_0.md
109
99
  - doc/release_notes/0_2_0.md
110
100
  - doc/release_notes/0_2_1.md
@@ -128,7 +118,9 @@ files:
128
118
  - doc/release_notes/0_8_2.md
129
119
  - doc/release_notes/0_9_0.md
130
120
  - lib/httpx.rb
121
+ - lib/httpx/adapters/datadog.rb
131
122
  - lib/httpx/adapters/faraday.rb
123
+ - lib/httpx/adapters/webmock.rb
132
124
  - lib/httpx/altsvc.rb
133
125
  - lib/httpx/buffer.rb
134
126
  - lib/httpx/callbacks.rb
@@ -163,6 +155,9 @@ files:
163
155
  - lib/httpx/plugins/follow_redirects.rb
164
156
  - lib/httpx/plugins/h2c.rb
165
157
  - lib/httpx/plugins/multipart.rb
158
+ - lib/httpx/plugins/multipart/encoder.rb
159
+ - lib/httpx/plugins/multipart/mime_type_detector.rb
160
+ - lib/httpx/plugins/multipart/part.rb
166
161
  - lib/httpx/plugins/persistent.rb
167
162
  - lib/httpx/plugins/proxy.rb
168
163
  - lib/httpx/plugins/proxy/http.rb
@@ -203,7 +198,6 @@ files:
203
198
  - sig/headers.rbs
204
199
  - sig/httpx.rbs
205
200
  - sig/loggable.rbs
206
- - sig/missing.rbs
207
201
  - sig/options.rbs
208
202
  - sig/parser/http1.rbs
209
203
  - sig/plugins/authentication.rbs
@@ -270,7 +264,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
270
264
  - !ruby/object:Gem::Version
271
265
  version: '0'
272
266
  requirements: []
273
- rubygems_version: 3.1.4
267
+ rubygems_version: 3.2.3
274
268
  signing_key:
275
269
  specification_version: 4
276
270
  summary: HTTPX, to the future, and beyond
data/sig/missing.rbs DELETED
@@ -1,12 +0,0 @@
1
- # defining these here, as I don't think there's hope of http-cookie to ever become type-friendly
2
- module HTTP
3
- class Cookie
4
- end
5
- class CookieJar
6
- end
7
- end
8
-
9
- module HTTP2Next
10
- class Stream
11
- end
12
- end