Module: SalesforceApi::Request

Included in:
Salesforceapi::Rest::Client
Defined in:
lib/salesforceapi-rest/request.rb

Class Method Summary collapse

Class Method Details

.do_request(verb, target, headers, data = nil) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/salesforceapi-rest/request.rb', line 6

def self.do_request (verb, target, headers, data=nil)
  case verb
  when 'GET'
    return resp = HTTParty.get(CGI::unescape(target), :headers => headers)
  when 'POST'
    return resp = HTTParty.post(CGI::unescape(target), :body => data, :headers => headers)
  when 'DELETE'
    return resp = HTTParty.delete(CGI::unescape(target), :headers => headers)
  end
end