def do_get(path, params={})
      login if need_login?

      # Resource id is a special param as it needs to be added to the path
      path = add_id_and_params_to_path(path, params)

      req, res, resource_type, body = nil

      begin
        retry_request(true) do
          # Return content type so the resulting resource object knows what kind of resource it is.
          resource_type, body = @rest_client[path].get(headers) do |response, request, result, &block|
            req, res = request, response
            update_cookies(response)
            update_last_request(request, response)

            case response.code
            when 200
              # Get the resource_type from the content_type, the resource_type
              # will be used later to add relevant methods to relevant resources
              type = if result.content_type.index('rightscale')
                get_resource_type(result.content_type)
              elsif result.content_type.index('text/plain')
                'text'
              else
                ''
              end

              # work around getting ASCII-8BIT from some resources like audit entry detail
              charset = get_charset(response.headers)
              if charset && response.body.encoding != charset
                response.body.force_encoding(charset)
              end

              # raise an error if the API is misbehaving and returning an empty response when it shouldn't
              if type != 'text' && response.body.empty?
                raise EmptyBodyError.new(request, response)
              end

              [type, response.body]
            when 301, 302
              update_api_url(response)
              response.follow_redirection(request, result, &block)
            when 404
              raise UnknownRouteError.new(request, response)
            else
              raise ApiError.new(request, response)
            end
          end
        end
      rescue => e
        raise wrap(e, :get, path, params, req, res)
      end

      data = if resource_type == 'text'
        { 'text' => body }
      else
        JSON.parse(body, :allow_nan => true)
      end

      [resource_type, path, data]
    end
def do_get(path, params={})
      login if need_login?

      # Resource id is a special param as it needs to be added to the path
      path = add_id_and_params_to_path(path, params)

      req, res, resource_type, body = nil

      begin
        retry_request(true) do
          # Return content type so the resulting resource object knows what kind of resource it is.
          resource_type, body = @rest_client[path].get(headers) do |response, request, result, &block|
            req, res = request, response
            update_cookies(response)
            update_last_request(request, response)

            case response.code
            when 200
              # Get the resource_type from the content_type, the resource_type
              # will be used later to add relevant methods to relevant resources
              type = if result.content_type.index('rightscale')
                get_resource_type(result.content_type)
              elsif result.content_type.index('text/plain')
                'text'
              else
                ''
              end

              # work around getting ASCII-8BIT from some resources like audit entry detail
              charset = get_charset(response.headers)
              if charset && response.body.encoding != charset
                response.body.force_encoding(charset)
              end

              # raise an error if the API is misbehaving and returning an empty response when it shouldn't
              if type != 'text' && response.body.empty?
                raise EmptyBodyError.new(request, response)
              end

              [type, response.body]
            when 301, 302
              update_api_url(response)
              response.follow_redirection(request, result, &block)
            when 404
              raise UnknownRouteError.new(request, response)
            else
              raise ApiError.new(request, response)
            end
          end
        end
      rescue => e
        raise wrap(e, :get, path, params, req, res)
      end

      data = if resource_type == 'text'
        { 'text' => body }
      else
        JSON.parse(body, :allow_nan => true)
      end

      [resource_type, path, data]
    end
Generic get
 params are NOT read only