Method: Magpie::Utils#start_http

Defined in:
lib/magpie/utils.rb

#start_http(url, req) ⇒ Object



84
85
86
87
88
89
90
91
# File 'lib/magpie/utils.rb', line 84

def start_http(url, req)
  http = Net::HTTP.new(url.host, url.port)
  if url.scheme == "https"
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
  end
  http.start{ |hp| hp.request req }
end