diff options
author | Rob Bradford <rob@o-hand.com> | 2008-08-20 17:01:46 +0100 |
---|---|---|
committer | Rob Bradford <rob@o-hand.com> | 2008-08-20 17:01:46 +0100 |
commit | add0d338451e0e4dc197edde5fb0baa723865ea3 (patch) | |
tree | 999d6a0f59b3516af69601f6de2ba8625d6608df /examples/test-raw.c | |
parent | ef9df21bff3f51b84596fbc274d3cff420842a1e (diff) | |
download | librest-add0d338451e0e4dc197edde5fb0baa723865ea3.tar.gz |
Make the "raw" test more interesting.
Diffstat (limited to 'examples/test-raw.c')
-rw-r--r-- | examples/test-raw.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/examples/test-raw.c b/examples/test-raw.c index eddba43..c99bdea 100644 --- a/examples/test-raw.c +++ b/examples/test-raw.c @@ -11,6 +11,7 @@ proxy_call_raw_async_cb (RestProxy *proxy, gpointer userdata) { write (1, payload, len); + g_main_loop_quit ((GMainLoop *)userdata); } gint @@ -18,21 +19,48 @@ main (gint argc, gchar **argv) { RestProxy *proxy; GMainLoop *loop; + gchar *payload; + gssize len; g_type_init (); g_thread_init (NULL); loop = g_main_loop_new (NULL, FALSE); - proxy = rest_proxy_new ("http://www.o-hand.com/", FALSE); + proxy = rest_proxy_new ("http://www.flickr.com/services/rest/", FALSE); rest_proxy_call_raw_async (proxy, NULL, "GET", proxy_call_raw_async_cb, NULL, + loop, NULL, - NULL, + "method", + "flickr.test.echo", + "api_key", + "314691be2e63a4d58994b2be01faacfb", + "format", + "json", NULL); g_main_loop_run (loop); + + rest_proxy_run_raw (proxy, + NULL, + "GET", + NULL, + NULL, + NULL, + &payload, + &len, + NULL, + "method", + "flickr.test.echo", + "api_key", + "314691be2e63a4d58994b2be01faacfb", + "format", + "json", + NULL); + + write (1, payload, len); } |