def request(method, path, params, options)
      uri = options[:host] || @host
      uri = URI(uri) unless uri.respond_to?(:host)
      uri += path
      request_headers = {}
      if self.credentials?
        # When posting a file, don't sign any params
        # signature_params = if [:post, :put].include?(method.to_sym) && params.values.any?{|value| value.is_a?(File) || (value.is_a?(Hash) && (value[:io].is_a?(IO) || value[:io].is_a?(StringIO)))}
        #   {}
        # else
        #   params
        # end
        # authorization = SimpleOAuth::Header.new(method, uri, signature_params, credentials)
        # request_headers[:authorization] = authorization.to_s
        connection.basic_auth(credentials[:user], credentials[:password])
      end
      connection.url_prefix = options[:host] || @host
      connection.run_request(method.to_sym, path, nil, request_headers) do |request|
        unless params.empty?
          case request.method
          when :post, :put
            request.body = params
          else
            request.params.update(params)
          end
        end
        yield request if block_given?
      end.env
    rescue Faraday::Error::ClientError
      raise VulnDBHQ::Error::ClientError
    end
def request(method, path, params, options)
      uri = options[:host] || @host
      uri = URI(uri) unless uri.respond_to?(:host)
      uri += path
      request_headers = {}
      if self.credentials?
        # When posting a file, don't sign any params
        # signature_params = if [:post, :put].include?(method.to_sym) && params.values.any?{|value| value.is_a?(File) || (value.is_a?(Hash) && (value[:io].is_a?(IO) || value[:io].is_a?(StringIO)))}
        #   {}
        # else
        #   params
        # end
        # authorization = SimpleOAuth::Header.new(method, uri, signature_params, credentials)
        # request_headers[:authorization] = authorization.to_s
        connection.basic_auth(credentials[:user], credentials[:password])
      end
      connection.url_prefix = options[:host] || @host
      connection.run_request(method.to_sym, path, nil, request_headers) do |request|
        unless params.empty?
          case request.method
          when :post, :put
            request.body = params
          else
            request.params.update(params)
          end
        end
        yield request if block_given?
      end.env
    rescue Faraday::Error::ClientError
      raise VulnDBHQ::Error::ClientError
    end
Perform an HTTP request