httpx 1.2.5 → 1.3.0
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/doc/release_notes/1_2_6.md +13 -0
- data/doc/release_notes/1_3_0.md +18 -0
- data/lib/httpx/adapters/datadog.rb +1 -1
- data/lib/httpx/adapters/faraday.rb +1 -0
- data/lib/httpx/adapters/webmock.rb +1 -1
- data/lib/httpx/connection/http1.rb +3 -2
- data/lib/httpx/connection/http2.rb +6 -6
- data/lib/httpx/connection.rb +11 -5
- data/lib/httpx/io/tcp.rb +1 -1
- data/lib/httpx/io/unix.rb +5 -3
- data/lib/httpx/options.rb +3 -7
- data/lib/httpx/parser/http1.rb +4 -0
- data/lib/httpx/plugins/aws_sigv4.rb +1 -1
- data/lib/httpx/plugins/cookies.rb +6 -6
- data/lib/httpx/plugins/follow_redirects.rb +44 -24
- data/lib/httpx/plugins/grpc.rb +3 -2
- data/lib/httpx/plugins/h2c.rb +1 -1
- data/lib/httpx/plugins/oauth.rb +1 -1
- data/lib/httpx/plugins/proxy/http.rb +2 -2
- data/lib/httpx/plugins/proxy/socks4.rb +1 -1
- data/lib/httpx/plugins/proxy/socks5.rb +1 -1
- data/lib/httpx/plugins/rate_limiter.rb +2 -0
- data/lib/httpx/plugins/ssrf_filter.rb +1 -1
- data/lib/httpx/request/body.rb +37 -41
- data/lib/httpx/request.rb +36 -10
- data/lib/httpx/resolver/https.rb +1 -1
- data/lib/httpx/resolver/native.rb +26 -8
- data/lib/httpx/resolver/resolver.rb +1 -1
- data/lib/httpx/response.rb +2 -2
- data/lib/httpx/session.rb +20 -17
- data/lib/httpx/timers.rb +1 -1
- data/lib/httpx/transcoder/multipart/encoder.rb +1 -1
- data/lib/httpx/version.rb +1 -1
- data/sig/chainable.rbs +2 -2
- data/sig/connection/http1.rbs +2 -2
- data/sig/connection/http2.rbs +17 -17
- data/sig/connection.rbs +7 -6
- data/sig/httpx.rbs +3 -3
- data/sig/io/ssl.rbs +1 -0
- data/sig/io/tcp.rbs +1 -1
- data/sig/io/unix.rbs +18 -1
- data/sig/options.rbs +5 -14
- data/sig/parser/http1.rbs +1 -1
- data/sig/plugins/callbacks.rbs +1 -1
- data/sig/plugins/follow_redirects.rbs +10 -5
- data/sig/plugins/grpc.rbs +5 -0
- data/sig/plugins/proxy/http.rbs +3 -0
- data/sig/plugins/proxy/socks4.rbs +5 -2
- data/sig/plugins/proxy/socks5.rbs +5 -2
- data/sig/plugins/push_promise.rbs +3 -3
- data/sig/plugins/rate_limiter.rbs +1 -1
- data/sig/plugins/retries.rbs +2 -0
- data/sig/request/body.rbs +1 -3
- data/sig/request.rbs +2 -1
- data/sig/resolver/https.rbs +1 -1
- data/sig/resolver/native.rbs +2 -0
- data/sig/resolver/resolver.rbs +1 -1
- data/sig/response.rbs +1 -1
- data/sig/session.rbs +10 -7
- data/sig/transcoder/multipart.rbs +11 -6
- data/sig/transcoder/xml.rbs +1 -0
- data/sig/utils.rbs +4 -0
- metadata +10 -6
data/sig/parser/http1.rbs
CHANGED
data/sig/plugins/callbacks.rbs
CHANGED
@@ -7,7 +7,7 @@ module HTTPX
|
|
7
7
|
module InstanceMethods
|
8
8
|
include HTTPX::Callbacks
|
9
9
|
|
10
|
-
type socket = TCPSocket | SSLSocket | UNIXSocket
|
10
|
+
type socket = TCPSocket | OpenSSL::SSL::SSLSocket | UNIXSocket
|
11
11
|
|
12
12
|
def on_connection_opened: () { (http_uri origin, socket sock) -> void } -> self
|
13
13
|
|
@@ -5,6 +5,9 @@ module HTTPX
|
|
5
5
|
module FollowRedirects
|
6
6
|
MAX_REDIRECTS: Integer
|
7
7
|
REDIRECT_STATUS: Range[Integer]
|
8
|
+
REQUEST_BODY_HEADERS: Array[String]
|
9
|
+
|
10
|
+
type redirect_request = Request & RequestMethods
|
8
11
|
|
9
12
|
interface _FollowRedirectsOptions
|
10
13
|
def max_redirects: () -> Integer?
|
@@ -13,7 +16,7 @@ module HTTPX
|
|
13
16
|
|
14
17
|
def allow_auth_to_other_origins: () -> bool?
|
15
18
|
|
16
|
-
def redirect_on: (http_uri) ->
|
19
|
+
def redirect_on: () -> (^(http_uri) -> boolish | nil)
|
17
20
|
end
|
18
21
|
|
19
22
|
def self.extra_options: (Options) -> (Options & _FollowRedirectsOptions)
|
@@ -21,17 +24,19 @@ module HTTPX
|
|
21
24
|
module InstanceMethods
|
22
25
|
def max_redirects: (_ToI) -> instance
|
23
26
|
|
24
|
-
def
|
27
|
+
def handle_after_redirect_request: (http_uri original_uri, http_uri redirect_uri, Request request, Options & _FollowRedirectsOptions options) -> void
|
25
28
|
|
26
|
-
def __get_location_from_response: (Response) ->
|
29
|
+
def __get_location_from_response: (Response) -> http_uri
|
27
30
|
end
|
28
31
|
|
29
32
|
module RequestMethods
|
30
33
|
attr_accessor root_request: instance?
|
31
34
|
|
32
|
-
|
35
|
+
@redirect_request: redirect_request
|
36
|
+
|
37
|
+
def redirect_request: () -> redirect_request
|
33
38
|
|
34
|
-
def redirect_request=: (
|
39
|
+
def redirect_request=: (redirect_request req) -> void
|
35
40
|
|
36
41
|
def max_redirects: () -> Integer
|
37
42
|
end
|
data/sig/plugins/grpc.rbs
CHANGED
@@ -7,6 +7,11 @@ module HTTPX
|
|
7
7
|
|
8
8
|
module Plugins
|
9
9
|
module GRPC
|
10
|
+
DEADLINE: Integer
|
11
|
+
MARSHAL_METHOD: Symbol
|
12
|
+
UNMARSHAL_METHOD: Symbol
|
13
|
+
HEADERS: Hash[String, String]
|
14
|
+
|
10
15
|
type compression_option = bool | String
|
11
16
|
type rpc_def = [String, untyped, untyped, Hash[Symbol, untyped]]
|
12
17
|
|
data/sig/plugins/proxy/http.rbs
CHANGED
@@ -13,7 +13,10 @@ module HTTPX
|
|
13
13
|
end
|
14
14
|
|
15
15
|
class SocksParser
|
16
|
-
include Callbacks
|
16
|
+
include HTTPX::Callbacks
|
17
|
+
|
18
|
+
@buffer: Buffer
|
19
|
+
@options: Options
|
17
20
|
|
18
21
|
def close: () -> void
|
19
22
|
def consume: (*untyped) -> void
|
@@ -22,7 +25,7 @@ module HTTPX
|
|
22
25
|
|
23
26
|
private
|
24
27
|
|
25
|
-
def initialize: (Buffer buffer, Options) -> untyped
|
28
|
+
def initialize: (Buffer buffer, Options options) -> untyped
|
26
29
|
end
|
27
30
|
|
28
31
|
module Packet
|
@@ -15,7 +15,10 @@ module HTTPX
|
|
15
15
|
end
|
16
16
|
|
17
17
|
class SocksParser
|
18
|
-
include Callbacks
|
18
|
+
include HTTPX::Callbacks
|
19
|
+
|
20
|
+
@buffer: Buffer
|
21
|
+
@options: Options
|
19
22
|
|
20
23
|
def close: () -> void
|
21
24
|
def consume: (*untyped) -> void
|
@@ -24,7 +27,7 @@ module HTTPX
|
|
24
27
|
|
25
28
|
private
|
26
29
|
|
27
|
-
def initialize: (Buffer buffer, Options) -> untyped
|
30
|
+
def initialize: (Buffer buffer, Options options) -> untyped
|
28
31
|
end
|
29
32
|
|
30
33
|
module Packet
|
@@ -9,9 +9,9 @@ module HTTPX
|
|
9
9
|
module InstanceMethods
|
10
10
|
private
|
11
11
|
|
12
|
-
def promise_headers: () -> Hash[
|
13
|
-
def __on_promise_request: (Connection::HTTP2,
|
14
|
-
def __on_promise_response: (Connection::HTTP2,
|
12
|
+
def promise_headers: () -> Hash[::HTTP2::Stream, Request]
|
13
|
+
def __on_promise_request: (Connection::HTTP2, ::HTTP2::Stream, headers_input) -> void
|
14
|
+
def __on_promise_response: (Connection::HTTP2, ::HTTP2::Stream, headers_input) -> void
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
data/sig/plugins/retries.rbs
CHANGED
@@ -29,6 +29,8 @@ module HTTPX
|
|
29
29
|
|
30
30
|
private
|
31
31
|
|
32
|
+
def fetch_response: (retriesRequest request, Array[Connection] connections, retriesOptions options) -> (retriesResponse | ErrorResponse)?
|
33
|
+
|
32
34
|
def __repeatable_request?: (retriesRequest request, retriesOptions options) -> boolish
|
33
35
|
|
34
36
|
def __retryable_error?: (_Exception error) -> bool
|
data/sig/request/body.rbs
CHANGED
@@ -4,7 +4,7 @@ module HTTPX
|
|
4
4
|
@body: body_encoder?
|
5
5
|
@unbounded_body: bool
|
6
6
|
|
7
|
-
def initialize: (Headers headers, Options options) -> void
|
7
|
+
def initialize: (Headers headers, Options options, ?body: bodyIO, ?form: Transcoder::urlencoded_input?, ?json: _ToJson?, **untyped) -> void
|
8
8
|
|
9
9
|
def each: () { (String) -> void } -> void
|
10
10
|
| () -> Enumerable[String]
|
@@ -25,8 +25,6 @@ module HTTPX
|
|
25
25
|
|
26
26
|
private
|
27
27
|
|
28
|
-
def initialize_body: (Options options) -> void
|
29
|
-
|
30
28
|
def self.initialize_deflater_body: (body_encoder body, Encoding | String encoding) -> body_encoder
|
31
29
|
end
|
32
30
|
|
data/sig/request.rbs
CHANGED
@@ -19,12 +19,13 @@ module HTTPX
|
|
19
19
|
|
20
20
|
attr_writer persistent: bool
|
21
21
|
|
22
|
+
@query_params: Hash[interned, untyped]?
|
22
23
|
@trailers: Headers?
|
23
24
|
@informational_status: Integer?
|
24
25
|
@query: String?
|
25
26
|
@drainer: Enumerator[String, void]?
|
26
27
|
|
27
|
-
def initialize: (Symbol | String, generic_uri, ?
|
28
|
+
def initialize: (Symbol | String verb, generic_uri uri, Options options, ?request_params params) -> untyped
|
28
29
|
|
29
30
|
def interests: () -> (:r | :w)
|
30
31
|
|
data/sig/resolver/https.rbs
CHANGED
data/sig/resolver/native.rbs
CHANGED
data/sig/resolver/resolver.rbs
CHANGED
@@ -26,7 +26,7 @@ module HTTPX
|
|
26
26
|
|
27
27
|
def emit_resolved_connection: (Connection connection, Array[IPAddr] addresses, bool early_resolve) -> void
|
28
28
|
|
29
|
-
def initialize: (ip_family? family,
|
29
|
+
def initialize: (ip_family? family, Options options) -> void
|
30
30
|
|
31
31
|
def early_resolve: (Connection connection, ?hostname: String) -> void
|
32
32
|
|
data/sig/response.rbs
CHANGED
data/sig/session.rbs
CHANGED
@@ -15,7 +15,7 @@ module HTTPX
|
|
15
15
|
|
16
16
|
def close: (*untyped) -> void
|
17
17
|
|
18
|
-
def build_request: (verb, generic_uri, ?options) -> Request
|
18
|
+
def build_request: (verb verb, generic_uri uri, ?request_params params, ?Options options) -> Request
|
19
19
|
|
20
20
|
def initialize: (?options) { (self) -> void } -> void
|
21
21
|
| (?options) -> void
|
@@ -23,8 +23,11 @@ module HTTPX
|
|
23
23
|
private
|
24
24
|
|
25
25
|
def pool: -> Pool
|
26
|
+
|
26
27
|
def on_response: (Request, response) -> void
|
28
|
+
|
27
29
|
def on_promise: (untyped, untyped) -> void
|
30
|
+
|
28
31
|
def fetch_response: (Request request, Array[Connection] connections, untyped options) -> response?
|
29
32
|
|
30
33
|
def find_connection: (Request request, Array[Connection] connections, Options options) -> Connection
|
@@ -37,13 +40,13 @@ module HTTPX
|
|
37
40
|
|
38
41
|
def build_altsvc_connection: (Connection existing_connection, Array[Connection] connections, URI::Generic alt_origin, String origin, Hash[String, String] alt_params, Options options) -> (Connection & AltSvc::ConnectionMixin)?
|
39
42
|
|
40
|
-
def build_requests: (verb, uri,
|
41
|
-
| (Array[[verb, uri,
|
42
|
-
| (Array[[verb, uri]],
|
43
|
-
| (verb, _Each[[uri,
|
44
|
-
| (verb, _Each[uri],
|
43
|
+
def build_requests: (verb, uri, request_params) -> Array[Request]
|
44
|
+
| (Array[[verb, uri, request_params]], Hash[Symbol, untyped]) -> Array[Request]
|
45
|
+
| (Array[[verb, uri]], request_params) -> Array[Request]
|
46
|
+
| (verb, _Each[[uri, request_params]], Hash[Symbol, untyped]) -> Array[Request]
|
47
|
+
| (verb, _Each[uri], request_params) -> Array[Request]
|
45
48
|
|
46
|
-
def init_connection: (
|
49
|
+
def init_connection: (http_uri uri, Options options) -> Connection
|
47
50
|
|
48
51
|
def send_requests: (*Request) -> Array[response]
|
49
52
|
|
@@ -21,8 +21,8 @@ module HTTPX
|
|
21
21
|
@part_index: Integer
|
22
22
|
@buffer: String
|
23
23
|
|
24
|
-
@form: Enumerable[[Symbol | string, multipart_nested_value]]
|
25
|
-
@parts: Array[_Reader]
|
24
|
+
@form: Enumerable[[Symbol | string, Object & multipart_nested_value]]
|
25
|
+
@parts: Array[Object & _Reader]
|
26
26
|
|
27
27
|
def bytesize: () -> Integer
|
28
28
|
|
@@ -40,13 +40,18 @@ module HTTPX
|
|
40
40
|
|
41
41
|
def header_part: (string key, String content_type, String? filename) -> StringIO
|
42
42
|
|
43
|
-
def read_chunks: (String buffer, ?
|
43
|
+
def read_chunks: (String buffer, ?int? length) -> void
|
44
44
|
|
45
|
-
def read_from_part: (?
|
45
|
+
def read_from_part: (?int? max_length) -> String?
|
46
46
|
end
|
47
47
|
|
48
48
|
class Decoder
|
49
|
+
CRLF: String
|
49
50
|
BOUNDARY_RE: Regexp
|
51
|
+
MULTIPART_CONTENT_TYPE: Regexp
|
52
|
+
MULTIPART_CONTENT_DISPOSITION: Regexp
|
53
|
+
MULTIPART_CONTENT_ID: Regexp
|
54
|
+
WINDOW_SIZE: Integer
|
50
55
|
|
51
56
|
@state: :idle | :part_header | :part_body | :parse_boundary | :done
|
52
57
|
@buffer: String
|
@@ -75,8 +80,8 @@ module HTTPX
|
|
75
80
|
end
|
76
81
|
|
77
82
|
module Part
|
78
|
-
def self?.call: [U] (_MultipartInput multipart_input) -> [U, String, String]
|
79
|
-
| (multipart_nested_value input) -> ([StringIO, String, String?] | [File, String, String])
|
83
|
+
def self?.call: [U] (Object & _MultipartInput multipart_input) -> [U, String, String]
|
84
|
+
| (Object & multipart_nested_value input) -> ([StringIO, String, String?] | [File, String, String])
|
80
85
|
end
|
81
86
|
|
82
87
|
module MimeTypeDetector
|
data/sig/transcoder/xml.rbs
CHANGED
data/sig/utils.rbs
CHANGED
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: httpx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.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: 2024-
|
11
|
+
date: 2024-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: http-2
|
14
|
+
name: http-2
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.0.
|
19
|
+
version: 1.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.0.
|
26
|
+
version: 1.0.0
|
27
27
|
description: A client library for making HTTP requests from Ruby.
|
28
28
|
email:
|
29
29
|
- cardoso_tiago@hotmail.com
|
@@ -143,6 +143,8 @@ extra_rdoc_files:
|
|
143
143
|
- doc/release_notes/1_2_3.md
|
144
144
|
- doc/release_notes/1_2_4.md
|
145
145
|
- doc/release_notes/1_2_5.md
|
146
|
+
- doc/release_notes/1_2_6.md
|
147
|
+
- doc/release_notes/1_3_0.md
|
146
148
|
files:
|
147
149
|
- LICENSE.txt
|
148
150
|
- README.md
|
@@ -257,6 +259,8 @@ files:
|
|
257
259
|
- doc/release_notes/1_2_3.md
|
258
260
|
- doc/release_notes/1_2_4.md
|
259
261
|
- doc/release_notes/1_2_5.md
|
262
|
+
- doc/release_notes/1_2_6.md
|
263
|
+
- doc/release_notes/1_3_0.md
|
260
264
|
- lib/httpx.rb
|
261
265
|
- lib/httpx/adapters/datadog.rb
|
262
266
|
- lib/httpx/adapters/faraday.rb
|
@@ -473,7 +477,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
473
477
|
- !ruby/object:Gem::Version
|
474
478
|
version: '0'
|
475
479
|
requirements: []
|
476
|
-
rubygems_version: 3.
|
480
|
+
rubygems_version: 3.5.3
|
477
481
|
signing_key:
|
478
482
|
specification_version: 4
|
479
483
|
summary: HTTPX, to the future, and beyond
|