Sha256: f1bff4f748527ca6d5215b5e38bbe809e9cf0d792bb33e7517c9715ea3dc5c44
Contents?: true
Size: 1.07 KB
Versions: 21
Compression:
Stored size: 1.07 KB
Contents
module Salesforce module Connection module Async extend ActiveSupport::Concern module ClassMethods 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 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 def async_api_url(path) ::Salesforce::Config.async_url + "/" + path end def async_headers(options) { 'X-SFDC-Session' => Salesforce::Authentication.session_id }.merge(content_type_headers(options)) end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems