Class: Locomotive::Steam::ExternalAPIService
- Inherits:
-
Object
- Object
- Locomotive::Steam::ExternalAPIService
- Includes:
- HTTParty
- Defined in:
- lib/locomotive/steam/services/external_api_service.rb
Instance Method Summary collapse
-
#consume(url, options = {}, with_status = false) ⇒ Object
Available option keys: - method - data - format - username / password (basic auth) - headers - header_auth - with_user_agent.
Instance Method Details
#consume(url, options = {}, with_status = false) ⇒ Object
Available option keys:
-
method
-
data
-
format
-
username / password (basic auth)
-
headers
-
header_auth
-
with_user_agent
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/locomotive/steam/services/external_api_service.rb', line 24 def consume(url, = {}, with_status = false) base_uri, path = extract_base_uri_and_path(url) method = ([:method] || 'GET').to_s.downcase = (, method) [:base_uri] = base_uri if with_status verbose_perform_request_to(method, path, ) else perform_request_to(method, path, ) end end |