Top Level Namespace

Instance Method Summary collapse

Instance Method Details

#get_code(server, port, path, headers = {}) ⇒ Object



43
44
45
46
47
48
49
50
51
# File 'lib/fluent/test/https_output_test.rb', line 43

def get_code(server, port, path, headers={})
  require 'net/https' 
  https = Net::HTTP.new(server, port)
  https.use_ssl = true
  https.verify_mode = OpenSSL::SSL::VERIFY_NONE
  https.start {|http|
    http.get(path, headers).code
  } 
end

#get_content(server, port, path, headers = {}) ⇒ Object



52
53
54
55
56
57
58
59
60
# File 'lib/fluent/test/https_output_test.rb', line 52

def get_content(server, port, path, headers={})
  require 'net/https'
  https = Net::HTTP.new(server, port)
  https.use_ssl = true
  https.verify_mode = OpenSSL::SSL::VERIFY_NONE
  https.start {|http|
    http.get(path, headers).body
  } 
end