Module: RestClient2

Includes:
RestClient
Defined in:
lib/sentra/rest_client.rb

Class Method Summary collapse

Class Method Details

.get(url, headers = {}, &block) ⇒ Object



26
27
28
29
# File 'lib/sentra/rest_client.rb', line 26

def self.get(url, headers={}, &block)
  Request.execute(:method => :get, :url => url, :headers => headers,
                  :timeout => $timeout, :open_timeout => $open_timeout, &block)
end

.post(url, payload, headers = {}, &block) ⇒ Object



31
32
33
34
# File 'lib/sentra/rest_client.rb', line 31

def self.post(url, payload, headers={}, &block)
  Request.execute(:method => :post, :url => url, :payload => payload, :headers => headers,
                  :timeout => 20000, :open_timeout => 20000, &block)
end