| librest Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Properties | ||||
struct RestProxy; struct RestProxyClass; #define REST_PROXY_ERROR enum RestProxyError; RestProxy * rest_proxy_new (const gchar *url_format,gboolean binding_required); gboolean rest_proxy_bind (RestProxy *proxy,...); gboolean rest_proxy_bind_valist (RestProxy *proxy,va_list params); void rest_proxy_set_user_agent (RestProxy *proxy,const char *user_agent); const gchar * rest_proxy_get_user_agent (RestProxy *proxy); RestProxyCall * rest_proxy_new_call (RestProxy *proxy); gboolean rest_proxy_simple_run (RestProxy *proxy,gchar **payload,goffset *len,GError **error,...); gboolean rest_proxy_simple_run_valist (RestProxy *proxy,gchar **payload,goffset *len,GError **error,va_list params);
GObject +----RestProxy +----FlickrProxy +----LastfmProxy +----OAuth2Proxy +----OAuthProxy
"binding-required" gboolean : Read / Write "disable-cookies" gboolean : Read / Write / Construct Only "url-format" gchar* : Read / Write "user-agent" gchar* : Read / Write
struct RestProxyClass {
gboolean (*bind_valist)(RestProxy *proxy, va_list params);
RestProxyCall *(*new_call)(RestProxy *proxy);
gboolean (*simple_run_valist)(RestProxy *proxy, gchar **payload,
goffset *len, GError **error, va_list params);
};
Class structure for RestProxy for subclasses to implement specialised behaviour.
Typically subclasses will override new_call to construct a subclass of
RestProxyCall.
| Virtual function called to bind parameters. | |
| Virtual function called to construct a new RestProxyCall. | |
| Virtual function called when making a "simple" call. |
typedef enum {
REST_PROXY_ERROR_CANCELLED = 1,
REST_PROXY_ERROR_RESOLUTION,
REST_PROXY_ERROR_CONNECTION,
REST_PROXY_ERROR_SSL,
REST_PROXY_ERROR_IO,
REST_PROXY_ERROR_FAILED,
REST_PROXY_ERROR_HTTP_MULTIPLE_CHOICES = 300,
REST_PROXY_ERROR_HTTP_MOVED_PERMANENTLY = 301,
REST_PROXY_ERROR_HTTP_FOUND = 302,
REST_PROXY_ERROR_HTTP_SEE_OTHER = 303,
REST_PROXY_ERROR_HTTP_NOT_MODIFIED = 304,
REST_PROXY_ERROR_HTTP_USE_PROXY = 305,
REST_PROXY_ERROR_HTTP_THREEOHSIX = 306,
REST_PROXY_ERROR_HTTP_TEMPORARY_REDIRECT = 307,
REST_PROXY_ERROR_HTTP_BAD_REQUEST = 400,
REST_PROXY_ERROR_HTTP_UNAUTHORIZED = 401,
REST_PROXY_ERROR_HTTP_FOUROHTWO = 402,
REST_PROXY_ERROR_HTTP_FORBIDDEN = 403,
REST_PROXY_ERROR_HTTP_NOT_FOUND = 404,
REST_PROXY_ERROR_HTTP_METHOD_NOT_ALLOWED = 405,
REST_PROXY_ERROR_HTTP_NOT_ACCEPTABLE = 406,
REST_PROXY_ERROR_HTTP_PROXY_AUTHENTICATION_REQUIRED = 407,
REST_PROXY_ERROR_HTTP_REQUEST_TIMEOUT = 408,
REST_PROXY_ERROR_HTTP_CONFLICT = 409,
REST_PROXY_ERROR_HTTP_GONE = 410,
REST_PROXY_ERROR_HTTP_LENGTH_REQUIRED = 411,
REST_PROXY_ERROR_HTTP_PRECONDITION_FAILED = 412,
REST_PROXY_ERROR_HTTP_REQUEST_ENTITY_TOO_LARGE = 413,
REST_PROXY_ERROR_HTTP_REQUEST_URI_TOO_LONG = 414,
REST_PROXY_ERROR_HTTP_UNSUPPORTED_MEDIA_TYPE = 415,
REST_PROXY_ERROR_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416,
REST_PROXY_ERROR_HTTP_EXPECTATION_FAILED = 417,
REST_PROXY_ERROR_HTTP_INTERNAL_SERVER_ERROR = 500,
REST_PROXY_ERROR_HTTP_NOT_IMPLEMENTED = 501,
REST_PROXY_ERROR_HTTP_BAD_GATEWAY = 502,
REST_PROXY_ERROR_HTTP_SERVICE_UNAVAILABLE = 503,
REST_PROXY_ERROR_HTTP_GATEWAY_TIMEOUT = 504,
REST_PROXY_ERROR_HTTP_HTTP_VERSION_NOT_SUPPORTED = 505,
} RestProxyError;
Error domain used when returning errors from a RestProxy.
RestProxy * rest_proxy_new (const gchar *url_format,gboolean binding_required);
Create a new RestProxy for the specified endpoint url_format, using the
"GET" method.
Set binding_required to TRUE if the URL contains string formatting
operations (for example "http://foo.com/%s". These must be expanded
using rest_proxy_bind() before invoking the proxy.
|
the endpoint URL |
|
whether the URL needs to be bound before calling |
Returns : |
A new RestProxy. |
void rest_proxy_set_user_agent (RestProxy *proxy,const char *user_agent);
gboolean rest_proxy_simple_run (RestProxy *proxy,gchar **payload,goffset *len,GError **error,...);
"binding-required" property"binding-required" gboolean : Read / Write
Whether the URL format requires binding.
Default value: FALSE
"disable-cookies" property"disable-cookies" gboolean : Read / Write / Construct Only
Whether to disable cookie support.
Default value: FALSE
"url-format" property"url-format" gchar* : Read / Write
Format string for the RESTful url.
Default value: NULL
"user-agent" property"user-agent" gchar* : Read / Write
The User-Agent of the client.
Default value: NULL