Module: Salesforce::Connection::Async::ClassMethods
- Defined in:
- lib/salesforce/connection/async.rb
Instance Method Summary collapse
- #async_api_url(path) ⇒ Object
- #async_get(path, options = {}) ⇒ Object
- #async_headers(options) ⇒ Object
- #async_post(path, body, options = {}) ⇒ Object
Instance Method Details
#async_api_url(path) ⇒ Object
25 26 27 |
# File 'lib/salesforce/connection/async.rb', line 25 def async_api_url(path) ::Salesforce::Config.async_url + "/" + path end |
#async_get(path, options = {}) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/salesforce/connection/async.rb', line 16 def async_get(path, = {}) url = async_api_url(path) as_logged_in_user do convert_body RestClient.get(url, async_headers()), end rescue RestClient::ResourceNotFound, RestClient::BadRequest => e convert_error(e, url, ) end |
#async_headers(options) ⇒ Object
29 30 31 |
# File 'lib/salesforce/connection/async.rb', line 29 def async_headers() { 'X-SFDC-Session' => Salesforce::Authentication.session_id }.merge(content_type_headers()) end |
#async_post(path, body, options = {}) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/salesforce/connection/async.rb', line 7 def async_post(path, body, = {}) url = async_api_url(path) as_logged_in_user do convert_body(RestClient.post(url, body, async_headers()), ) end rescue RestClient::ResourceNotFound, RestClient::BadRequest => e convert_error(e, url, ) end |