| Top |
GObject
╰── RestProxyCall
├── FlickrProxyCall
├── LastfmProxyCall
├── OAuth2ProxyCall
╰── OAuthProxyCall
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.
const char *
rest_proxy_call_get_method (RestProxyCall *call);
Get the HTTP method to use when making the call, for example GET or POST.
void rest_proxy_call_set_function (RestProxyCall *call,const gchar *function);
Set the REST "function" to call on the proxy. This is appended to the URL,
so that for example a proxy with the URL
http://www.example.com/ and the function
test would actually access the URL
http://www.example.com/test
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 |
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.
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.
const gchar * rest_proxy_call_lookup_header (RestProxyCall *call,const gchar *header);
Get the value of the header called header
.
The header value, or NULL if it does not exist. This string is
owned by the RestProxyCall and should not be freed.
void rest_proxy_call_remove_header (RestProxyCall *call,const gchar *header);
Remove the header named header
from the call.
void rest_proxy_call_add_param (RestProxyCall *call,const gchar *name,const gchar *value);
Add a query parameter called param
with the string value value
to the call.
If a parameter with this name already exists, the new value will replace the
old.
call |
The RestProxyCall |
|
name |
The name of the parameter to set |
|
value |
The value of the parameter |
void rest_proxy_call_add_param_full (RestProxyCall *call,RestParam *param);
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.
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.
RestParam * rest_proxy_call_lookup_param (RestProxyCall *call,const gchar *name);
Get the value of the parameter called name
.
The parameter value, or NULL if it does not exist. This string is
owned by the RestProxyCall and should not be freed.
void rest_proxy_call_remove_param (RestProxyCall *call,const gchar *name);
Remove the parameter named name
from the call.
RestParams *
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.
gboolean rest_proxy_call_run (RestProxyCall *call,GMainLoop **loop,GError **error);
void (*RestProxyCallAsyncCallback) (RestProxyCall *call,const 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);
Get the string value of the header header
or NULL if that header is not
present or there are no headers.
GHashTable *
rest_proxy_call_get_response_headers (RestProxyCall *call);
goffset
rest_proxy_call_get_payload_length (RestProxyCall *call);
Get the length of the return payload.
const gchar *
rest_proxy_call_get_payload (RestProxyCall *call);
Get the return payload.
guint
rest_proxy_call_get_status_code (RestProxyCall *call);
Get the HTTP status code for the call.
const gchar *
rest_proxy_call_get_status_message (RestProxyCall *call);
Get the human-readable HTTP status message for the call.
typedef struct _RestProxyCall RestProxyCall;
RestProxyCall has no publicly available members.