module Salesforce::Connection::Async::ClassMethods

Public Instance Methods

async_api_url(path) click to toggle source
# File lib/salesforce/connection/async.rb, line 25
def async_api_url(path)
  ::Salesforce::Config.async_url + "/" + path
end
async_get(path, options = {}) click to toggle source
# File lib/salesforce/connection/async.rb, line 16
def async_get(path, options = {})
  url = async_api_url(path)
  as_logged_in_user do
    convert_body RestClient.get(url, async_headers(options)), options
  end
rescue RestClient::ResourceNotFound, RestClient::BadRequest => e
  convert_error(e, url, options)
end
async_headers(options) click to toggle source
# File lib/salesforce/connection/async.rb, line 29
def async_headers(options)
  { 'X-SFDC-Session' => Salesforce::Authentication.session_id }.merge(content_type_headers(options))
end
async_post(path, body, options = {}) click to toggle source
# File lib/salesforce/connection/async.rb, line 7
def async_post(path, body, options = {})
  url = async_api_url(path)
  as_logged_in_user do
    convert_body(RestClient.post(url, body, async_headers(options)), options)
  end
rescue RestClient::ResourceNotFound, RestClient::BadRequest => e
  convert_error(e, url, options)
end