class ActiveGenie::Clients::BaseClient
def create_http_client(uri, config)
-
(Net::HTTP)
- Configured HTTP client
Parameters:
-
config
(Hash
) -- Configuration options -
uri
(URI
) -- The URI for the request
def create_http_client(uri, config) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = (uri.scheme == 'https') http.verify_mode = OpenSSL::SSL::VERIFY_PEER http.read_timeout = config.dig(:runtime, :timeout) || DEFAULT_TIMEOUT http.open_timeout = config.dig(:runtime, :open_timeout) || DEFAULT_OPEN_TIMEOUT http end