excon 0.99.0 → 1.2.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4de69b0df9a1fc68f382e6d007845ddd9dac6ec8e6f0150b0988caafc604fc66
4
- data.tar.gz: 3735d61f7219a99bfcfd8f953c7dd16f66b0232a794c602042f30a7eda7c9334
3
+ metadata.gz: 03be8d14ca6bdef68492641f26ed1fc39aab7ec53dbb4c9c7020cd8d20c47de7
4
+ data.tar.gz: 2e995618462cf8d4c40f4f05dfb4782f82fca992066fe47b5e8caefa8e721c91
5
5
  SHA512:
6
- metadata.gz: 366bb5af60bbd24b607bb9306a5f1581e0daeb95881e33376e85a9a7892935758fb06c09d656f27ffd3f791fbcc372e9703bf738f08a10c5d46f06558a34e19e
7
- data.tar.gz: a38b16b4e9fe30c66d75e96e39330f6661a3c4a906801e7eaade9c3efd4af8d86a804b224d264f777f8d13026c0c1dc18581120ce179c5bfd6cf8ae3e427cd10
6
+ metadata.gz: 4680ec1d717b8bfd0718a15c2261e324cb1043f40033d2bd7a9a0bef016f9ee3b6595a8f6ed3d3e0f20581edf7bfe36c1e073726840adc66250c69aa45e17103
7
+ data.tar.gz: 290752b4fb510fd3954b21213f09373125ba04a074cef22b277f2954983651fd384d126a7a5d7f6e426a184014470621346aa840087a99803bf5c4cf3e20886c
data/README.md CHANGED
@@ -4,8 +4,8 @@ Usable, fast, simple Ruby HTTP 1.1
4
4
 
5
5
  Excon was designed to be simple, fast and performant. It works great as a general HTTP(s) client and is particularly well suited to usage in API clients.
6
6
 
7
- [![Build Status](https://github.com/excon/excon/actions/workflows/ruby.yml/badge.svg)](https://github.com/excon/excon/actions/workflows/ruby.yml)
8
- [![Gem Version](https://badge.fury.io/rb/excon.svg)](https://badge.fury.io/rb/excon)
7
+ [![Build Status](https://github.com/excon/excon/actions/workflows/ci.yml/badge.svg)](https://github.com/excon/excon/actions/workflows/ci.yml)
8
+ [![Gem Version](https://badge.fury.io/rb/excon.svg)](https://rubygems.org/gems/excon)
9
9
 
10
10
  - [Getting Started](#getting-started)
11
11
  - [Options](#options)
@@ -179,6 +179,10 @@ connection.request(:read_timeout => 360)
179
179
  # set longer write_timeout (default is 60 seconds)
180
180
  connection.request(:write_timeout => 360)
181
181
 
182
+ # set a request timeout in seconds (default is no timeout).
183
+ # the timeout may be an integer or a float to support sub-second granularity (e.g., 1, 60, 0.005 and 3.5).
184
+ connection.request(:timeout => 0.1) # timeout if the entire request takes longer than 100 milliseconds
185
+
182
186
  # Enable the socket option TCP_NODELAY on the underlying socket.
183
187
  #
184
188
  # This can improve response time when sending frequent short
@@ -186,11 +190,29 @@ connection.request(:write_timeout => 360)
186
190
  #
187
191
  connection = Excon.new('http://geemus.com/', :tcp_nodelay => true)
188
192
 
193
+ # opt-in to having Excon add a default port (http:80 and https:443)
194
+ connection = Excon.new('http://geemus.com/', :include_default_port => true)
195
+
189
196
  # set longer connect_timeout (default is 60 seconds)
190
197
  connection = Excon.new('http://geemus.com/', :connect_timeout => 360)
191
198
 
192
199
  # opt-out of nonblocking operations for performance and/or as a workaround
193
200
  connection = Excon.new('http://geemus.com/', :nonblock => false)
201
+
202
+ # DEPRECATED in favour of `resolv_resolver` (see below)
203
+ # set up desired dns_timeouts for resolving addresses (default is set by Resolv)
204
+ # it accepts an integer or an array of integers for retrying with different timeouts
205
+ # see Resolv::DNS#timeouts for more details (https://ruby-doc.org/3.2.2/stdlibs/resolv/Resolv/DNS.html#method-i-timeouts-3D)
206
+ connection = Excon.new('http://geemus.com/', :dns_timeouts => 3)
207
+
208
+ # set a custom resolver for Resolv
209
+ # you can use custom nameservers and timeouts
210
+ # `timeouts` accepts an integer or an array of integers for retrying with different timeouts
211
+ # see Resolv::DNS#timeouts for more details (https://ruby-doc.org/3.2.2/stdlibs/resolv/Resolv/DNS.html#method-i-timeouts-3D)
212
+ dns_resolver = Resolv::DNS.new(nameserver: ['127.0.0.1'])
213
+ dns_resolver.timeouts = 3
214
+ resolver = Resolv.new([Resolv::Hosts.new, dns_resolver])
215
+ connection = Excon.new('http://geemus.com', :resolv_resolver => resolver)
194
216
  ```
195
217
 
196
218
  ## Chunked Requests