summaryrefslogtreecommitdiff
path: root/rest/rest-proxy.h
diff options
context:
space:
mode:
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 */