def fetch(api_request)
      uri = api_request.to_uri
      response = Net::HTTP.start(uri.host, use_ssl: api_request.ssl?) do |http|
        http.read_timeout = 5
        http.open_timeout = 5
        http.get uri.request_uri, REQUEST_HEADERS
      end

      handle_response(api_request, response)

    rescue Timeout::Error => e
      ErrorResponse.new(api_request, e.class.name).to_h
    end
def fetch(api_request)
      uri = api_request.to_uri
      response = Net::HTTP.start(uri.host, use_ssl: api_request.ssl?) do |http|
        http.read_timeout = 5
        http.open_timeout = 5
        http.get uri.request_uri, REQUEST_HEADERS
      end

      handle_response(api_request, response)

    rescue Timeout::Error => e
      ErrorResponse.new(api_request, e.class.name).to_h
    end
Perform API request; return hash with html content