Module: Philiprehberger::HttpClient
- Defined in:
- lib/philiprehberger/http_client.rb,
lib/philiprehberger/http_client/pool.rb,
lib/philiprehberger/http_client/cache.rb,
lib/philiprehberger/http_client/client.rb,
lib/philiprehberger/http_client/errors.rb,
lib/philiprehberger/http_client/metrics.rb,
lib/philiprehberger/http_client/retries.rb,
lib/philiprehberger/http_client/version.rb,
lib/philiprehberger/http_client/response.rb,
lib/philiprehberger/http_client/multipart.rb,
lib/philiprehberger/http_client/connection.rb,
lib/philiprehberger/http_client/cookie_jar.rb,
lib/philiprehberger/http_client/body_encoder.rb
Defined Under Namespace
Modules: BodyEncoder, Connection, Multipart, Retries Classes: Cache, Client, ConfigurationError, CookieJar, Error, HttpError, Metrics, NetworkError, Pool, Response, TimeoutError
Constant Summary collapse
- VERSION =
'0.9.1'
Class Method Summary collapse
-
.new(**options) ⇒ Client
Convenience constructor that instantiates a new Client.
-
.open {|client| ... } ⇒ Object
Block form constructor — creates a Client, yields it, and guarantees cleanup by calling ‘#close` in an `ensure` block when the block exits.
Class Method Details
.new(**options) ⇒ Client
27 28 29 |
# File 'lib/philiprehberger/http_client.rb', line 27 def self.new(**) Client.new(**) end |
.open {|client| ... } ⇒ Object
Block form constructor — creates a Client, yields it, and guarantees cleanup by calling ‘#close` in an `ensure` block when the block exits.
Equivalent to Philiprehberger::HttpClient::Client.open; prefer this form when you want automatic connection pool draining without manually calling ‘#close`.
41 42 43 |
# File 'lib/philiprehberger/http_client.rb', line 41 def self.open(...) Client.open(...) end |