diff options
author | Rob Bradford <rob@o-hand.com> | 2008-08-18 17:34:25 +0100 |
---|---|---|
committer | Rob Bradford <rob@o-hand.com> | 2008-08-18 17:34:25 +0100 |
commit | daacff4204496756124af8492a85a3a36ce591cc (patch) | |
tree | a42fbb708d50d4ec4241254cc7273e73a3a19653 /examples/test-raw.c | |
download | librest-daacff4204496756124af8492a85a3a36ce591cc.tar.gz |
Initial commit
Diffstat (limited to 'examples/test-raw.c')
-rw-r--r-- | examples/test-raw.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/examples/test-raw.c b/examples/test-raw.c new file mode 100644 index 0000000..eddba43 --- /dev/null +++ b/examples/test-raw.c @@ -0,0 +1,38 @@ +#include <rest/rest-proxy.h> + +static void +proxy_call_raw_async_cb (RestProxy *proxy, + guint status_code, + const gchar *response_message, + GHashTable *headers, + const gchar *payload, + gssize len, + GObject *weak_object, + gpointer userdata) +{ + write (1, payload, len); +} + +gint +main (gint argc, gchar **argv) +{ + RestProxy *proxy; + GMainLoop *loop; + + g_type_init (); + g_thread_init (NULL); + + loop = g_main_loop_new (NULL, FALSE); + + proxy = rest_proxy_new ("http://www.o-hand.com/", FALSE); + rest_proxy_call_raw_async (proxy, + NULL, + "GET", + proxy_call_raw_async_cb, + NULL, + NULL, + NULL, + NULL); + + g_main_loop_run (loop); +} |