summaryrefslogtreecommitdiff
path: root/rest/rest-proxy.h
diff options
context:
space:
mode:
authorRob Bradford <rob@o-hand.com>2008-08-20 16:54:59 +0100
committerRob Bradford <rob@o-hand.com>2008-08-20 16:54:59 +0100
commitec32164aa76444f74a61b73712db5ebb5b465573 (patch)
tree79e99f120221ac879420af9ea3920617f9243555 /rest/rest-proxy.h
parent82f8034aff90219098b3c86b764dd8d0edfc50bc (diff)
downloadlibrest-ec32164aa76444f74a61b73712db5ebb5b465573.tar.gz
Add functions to parse data using json-glib before handing it to the user
Diffstat (limited to 'rest/rest-proxy.h')
-rw-r--r--rest/rest-proxy.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/rest/rest-proxy.h b/rest/rest-proxy.h
index c995408..58f1d49 100644
--- a/rest/rest-proxy.h
+++ b/rest/rest-proxy.h
@@ -3,6 +3,8 @@
#include <glib-object.h>
+#include <json-glib/json-glib.h>
+
G_BEGIN_DECLS
#define REST_TYPE_PROXY rest_proxy_get_type()
@@ -39,6 +41,14 @@ typedef void (*RestProxyCallRawCallback)(RestProxy *proxy,
GObject *weak_object,
gpointer userdata);
+typedef void (*RestProxyCallJsonCallback)(RestProxy *proxy,
+ guint status_code,
+ const gchar *response_message,
+ GHashTable *headers,
+ JsonNode *root,
+ GObject *weak_object,
+ gpointer userdata);
+
GType rest_proxy_get_type (void);
RestProxy *rest_proxy_new (const gchar *url_format,
@@ -76,6 +86,27 @@ gboolean rest_proxy_run_raw (RestProxy *proxy,
const gchar *first_field_name,
...);
+gboolean rest_proxy_call_json_async (RestProxy *proxy,
+ const gchar *function,
+ const gchar *method,
+ RestProxyCallJsonCallback callback,
+ GObject *weak_object,
+ gpointer userdata,
+ GError **error,
+ const gchar *first_field_name,
+ ...);
+
+gboolean
+rest_proxy_call_json_async_valist (RestProxy *proxy,
+ const gchar *function,
+ const gchar *method,
+ RestProxyCallJsonCallback callback,
+ GObject *weak_object,
+ gpointer userdata,
+ GError **error,
+ const gchar *first_field_name,
+ va_list params);
+
G_END_DECLS
#endif /* _REST_PROXY */