const Gtk = imports.gi.Gtk;
const Rest = imports.gi.Rest;

function remote_call(proxy) {
  var call = proxy.new_call();
  call.add_param ("method", "flickr.test.echo");
  call.add_param ("api_key", "314691be2e63a4d58994b2be01faacfb");
  call.add_param ("format", "json");

  call.invoke_async(null, function (call, result) {
      print ("callback called");
  });
}

var proxy = new Rest.Proxy ( { 'url-format': 'http://www.flickr.com/services/rest/' });
remote_call(proxy);
remote_call(proxy);

Gtk.main();
