Class: ASHTTP

Inherits:
Object
  • Object
show all
Defined in:
common/ashttp.rb

Class Method Summary collapse

Class Method Details

.get(*args) ⇒ Object



15
16
17
# File 'common/ashttp.rb', line 15

def self.get(*args)
  Net::HTTP.get(*args)
end

.get_response(*args) ⇒ Object



19
20
21
# File 'common/ashttp.rb', line 19

def self.get_response(*args)
  Net::HTTP.get_response(*args)
end

.post_form(*args) ⇒ Object



23
24
25
# File 'common/ashttp.rb', line 23

def self.post_form(*args)
  Net::HTTP.post_form(*args)
end

.start_uri(uri, opts = {}) ⇒ Object



6
7
8
9
10
11
12
13
# File 'common/ashttp.rb', line 6

def self.start_uri(uri, opts = {})
  use_ssl = (uri.scheme == "https")
  opts = {:use_ssl => use_ssl}.merge(opts)

  Net::HTTP.start(uri.host, uri.port, opts) do |http|
    yield http
  end
end