Module: Philiprehberger::HttpClient::Connection
- Includes:
- BodyEncoder, Retries
- Included in:
- Client
- Defined in:
- lib/philiprehberger/http_client/connection.rb
Overview
Internal helpers for building URIs, HTTP connections, executing requests, and constructing Response objects. Mixed into Client to keep it concise.
Constant Summary collapse
- TIMEOUT_ERRORS =
[ Net::OpenTimeout, Net::ReadTimeout ].freeze
- NETWORK_ERRORS =
[ Errno::ECONNREFUSED, Errno::ECONNRESET, Errno::ETIMEDOUT, Errno::EHOSTUNREACH, Errno::ENETUNREACH, SocketError ].freeze
- RETRYABLE_ERRORS =
(TIMEOUT_ERRORS + NETWORK_ERRORS).freeze
- REDIRECT_CODES =
[301, 302, 303, 307, 308].freeze