Class: JamBase4R::HttpGateway
- Includes:
- Utility
- Defined in:
- lib/http_gateway.rb
Instance Method Summary collapse
Methods included from Utility
Instance Method Details
#get(url) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/http_gateway.rb', line 19 def get(url) log_info("#{self.class.name} - Performing GET with URL: #{url}.") url = URI.parse(url) request = Net::HTTP::Get.new(url.path_with_querystring) response = Net::HTTP.start(url.host, url.port) { |http| http.request(request) } handle_response(response) rescue Timeout::Error => e log_error("Connection to JamBase timed out: #{e.}") raise JamBaseError.new(e.) end |