RestProxyCall

RestProxyCall

Synopsis

                    RestProxyCall;
                    RestProxyCallClass;
void                rest_proxy_call_set_method          (RestProxyCall *call,
                                                         const gchar *method);
void                rest_proxy_call_add_header          (RestProxyCall *call,
                                                         const gchar *header,
                                                         const gchar *value);
void                rest_proxy_call_add_headers         (RestProxyCall *call,
                                                         ...);
void                rest_proxy_call_add_headers_from_valist
                                                        (RestProxyCall *call,
                                                         va_list headers);
const gchar *       rest_proxy_call_lookup_header       (RestProxyCall *call,
                                                         const gchar *header);
void                rest_proxy_call_remove_header       (RestProxyCall *call,
                                                         const gchar *header);
void                rest_proxy_call_add_param           (RestProxyCall *call,
                                                         const gchar *param,
                                                         const gchar *value);
void                rest_proxy_call_add_params          (RestProxyCall *call,
                                                         ...);
void                rest_proxy_call_add_params_from_valist
                                                        (RestProxyCall *call,
                                                         va_list params);
const gchar *       rest_proxy_call_lookup_param        (RestProxyCall *call,
                                                         const gchar *param);
void                rest_proxy_call_remove_param        (RestProxyCall *call,
                                                         const gchar *param);
GHashTable *        rest_proxy_call_get_params          (RestProxyCall *call);
gboolean            rest_proxy_call_run                 (RestProxyCall *call,
                                                         GMainLoop **loop,
                                                         GError **error);
void                (*RestProxyCallAsyncCallback)       (RestProxyCall *call,
                                                         GError *error,
                                                         GObject *weak_object,
                                                         gpointer userdata);
gboolean            rest_proxy_call_async               (RestProxyCall *call,
                                                         RestProxyCallAsyncCallback callback,
                                                         GObject *weak_object,
                                                         gpointer userdata,
                                                         GError **error);
const gchar *       rest_proxy_call_lookup_response_header
                                                        (RestProxyCall *call,
                                                         const gchar *header);
GHashTable *        rest_proxy_call_get_response_headers
                                                        (RestProxyCall *call);
goffset             rest_proxy_call_get_payload_length  (RestProxyCall *call);
const gchar *       rest_proxy_call_get_payload         (RestProxyCall *call);
guint               rest_proxy_call_get_status_code     (RestProxyCall *call);
const gchar *       rest_proxy_call_get_status_message  (RestProxyCall *call);

Object Hierarchy

  GObject
   +----RestProxyCall

Properties

  "proxy"                    RestProxy*            : Read / Write / Construct Only

Description

Details

RestProxyCall

typedef struct _RestProxyCall RestProxyCall;

RestProxyCall has no publicly available members.


RestProxyCallClass

typedef struct {
  gboolean (*prepare)(RestProxyCall *call, GError **error);
} RestProxyCallClass;

Class structure for RestProxy.

prepare ()

Virtual function called before making the request, This allows the call to be modified, for example to add a signature.

rest_proxy_call_set_method ()

void                rest_proxy_call_set_method          (RestProxyCall *call,
                                                         const gchar *method);

Set the HTTP method to use when making the call, for example GET or POST.

call :

The RestProxyCall

method :

The HTTP method to use

rest_proxy_call_add_header ()

void                rest_proxy_call_add_header          (RestProxyCall *call,
                                                         const gchar *header,
                                                         const gchar *value);

Add a header called header with the value value to the call. If a header with this name already exists, the new value will replace the old.

call :

The RestProxyCall

header :

The name of the header to set

value :

The value of the header

rest_proxy_call_add_headers ()

void                rest_proxy_call_add_headers         (RestProxyCall *call,
                                                         ...);

Add the specified header name and value pairs to the call. If a header already exists, the new value will replace the old.

call :

The RestProxyCall

... :

Header name and value pairs, followed by NULL.

rest_proxy_call_add_headers_from_valist ()

void                rest_proxy_call_add_headers_from_valist
                                                        (RestProxyCall *call,
                                                         va_list headers);

Add the specified header name and value pairs to the call. If a header already exists, the new value will replace the old.

call :

The RestProxyCall

headers :

Header name and value pairs, followed by NULL.

rest_proxy_call_lookup_header ()

const gchar *       rest_proxy_call_lookup_header       (RestProxyCall *call,
                                                         const gchar *header);

Get the value of the header called header.

call :

The RestProxyCall

header :

The header name

Returns :

The header value, or NULL if it does not exist. This string is owned by the RestProxyCall and should not be freed.

rest_proxy_call_remove_header ()

void                rest_proxy_call_remove_header       (RestProxyCall *call,
                                                         const gchar *header);

Remove the header named header from the call.

call :

The RestProxyCall

header :

The header name

rest_proxy_call_add_param ()

void                rest_proxy_call_add_param           (RestProxyCall *call,
                                                         const gchar *param,
                                                         const gchar *value);

Add a query parameter called param with the value value to the call. If a parameter with this name already exists, the new value will replace the old.

call :

The RestProxyCall

param :

The name of the parameter to set

value :

The value of the parameter

rest_proxy_call_add_params ()

void                rest_proxy_call_add_params          (RestProxyCall *call,
                                                         ...);

Add the specified parameter name and value pairs to the call. If a parameter already exists, the new value will replace the old.

call :

The RestProxyCall

... :

Parameter name and value pairs, followed by NULL.

rest_proxy_call_add_params_from_valist ()

void                rest_proxy_call_add_params_from_valist
                                                        (RestProxyCall *call,
                                                         va_list params);

Add the specified parameter name and value pairs to the call. If a parameter already exists, the new value will replace the old.

call :

The RestProxyCall

params :

Parameter name and value pairs, followed by NULL.

rest_proxy_call_lookup_param ()

const gchar *       rest_proxy_call_lookup_param        (RestProxyCall *call,
                                                         const gchar *param);

Get the value of the parameter called name.

call :

The RestProxyCall

param :

The paramter name

Returns :

The parameter value, or NULL if it does not exist. This string is owned by the RestProxyCall and should not be freed.

rest_proxy_call_remove_param ()

void                rest_proxy_call_remove_param        (RestProxyCall *call,
                                                         const gchar *param);

Remove the parameter named param from the call.

call :

The RestProxyCall

param :

The paramter name

rest_proxy_call_get_params ()

GHashTable *        rest_proxy_call_get_params          (RestProxyCall *call);

Get the parameters as a GHashTable of parameter names to values. The caller should call g_hash_table_unref() when they have finished using it.

call :

The RestProxyCall

Returns :

A GHashTable.

rest_proxy_call_run ()

gboolean            rest_proxy_call_run                 (RestProxyCall *call,
                                                         GMainLoop **loop,
                                                         GError **error);

RestProxyCallAsyncCallback ()

void                (*RestProxyCallAsyncCallback)       (RestProxyCall *call,
                                                         GError *error,
                                                         GObject *weak_object,
                                                         gpointer userdata);

rest_proxy_call_async ()

gboolean            rest_proxy_call_async               (RestProxyCall *call,
                                                         RestProxyCallAsyncCallback callback,
                                                         GObject *weak_object,
                                                         gpointer userdata,
                                                         GError **error);

rest_proxy_call_lookup_response_header ()

const gchar *       rest_proxy_call_lookup_response_header
                                                        (RestProxyCall *call,
                                                         const gchar *header);

call: The RestProxyCall header: The name of the header to lookup.

Returns :

The string value of the header header or NULL if that header is not present or there are no headers.

rest_proxy_call_get_response_headers ()

GHashTable *        rest_proxy_call_get_response_headers
                                                        (RestProxyCall *call);

call: The RestProxyCall

Returns :

A pointer to a hash table of headers. This hash table must not be changed. You should call g_hash_table_unref() when you have finished with it.

rest_proxy_call_get_payload_length ()

goffset             rest_proxy_call_get_payload_length  (RestProxyCall *call);

Get the length of the return payload.

call :

The RestProxyCall

Returns :

the length of the payload in bytes.

rest_proxy_call_get_payload ()

const gchar *       rest_proxy_call_get_payload         (RestProxyCall *call);

Get the return payload.

call :

The RestProxyCall

Returns :

A pointer to the payload. This is owned by RestProxyCall and should not be freed.

rest_proxy_call_get_status_code ()

guint               rest_proxy_call_get_status_code     (RestProxyCall *call);

Get the HTTP status code for the call.

call :

The RestProxyCall

rest_proxy_call_get_status_message ()

const gchar *       rest_proxy_call_get_status_message  (RestProxyCall *call);

Get the human-readable HTTP status message for the call.

call :

The RestProxyCall

Returns :

The status message. This string is owned by RestProxyCall and should not be freed.

Property Details

The "proxy" property

  "proxy"                    RestProxy*            : Read / Write / Construct Only

Proxy for this call.