Class: CFoundry::RestClient::HTTPFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/cfoundry/rest_client.rb

Class Method Summary collapse

Class Method Details

.create(uri, proxy_options = []) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/cfoundry/rest_client.rb', line 10

def self.create(uri, proxy_options = [])
  http = Net::HTTP.new(uri.host, uri.port, *proxy_options)

  if uri.is_a?(URI::HTTPS)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
  end

  return http
end