def call(function, params)
      start
      req = Net::HTTP::Post.new(DEFAULT_PATH)
      req.add_field('Content-Type', 'application/json; charset=utf-8')
      req.body = URI::encode({
        :jsonrpc => :'2.0',
        :method => function,
        :params => params,
        :id => 0 }.to_json({:ascii_only => true}))
      begin
        res = @conn.request(req)
        if res.is_a?(Net::HTTPSuccess)
          data = res.body
          return JSON.parse(data)['result']
        else
          raise ConnectionError.new(res)
        end
      rescue ConnectionError => error
        raise error
      rescue Exception => error
        raise ConnectionError.new(error)
      end
    end
def call(function, params)
      start
      req = Net::HTTP::Post.new(DEFAULT_PATH)
      req.add_field('Content-Type', 'application/json; charset=utf-8')
      req.body = URI::encode({
        :jsonrpc => :'2.0',
        :method => function,
        :params => params,
        :id => 0 }.to_json({:ascii_only => true}))
      begin
        res = @conn.request(req)
        if res.is_a?(Net::HTTPSuccess)
          data = res.body
          return JSON.parse(data)['result']
        else
          raise ConnectionError.new(res)
        end
      rescue ConnectionError => error
        raise error
      rescue Exception => error
        raise ConnectionError.new(error)
      end
    end
Calls the given function with the given parameters via the JSON
 interface of Scalaris.