RestProxy

RestProxy

Functions

Properties

gboolean binding-required Read / Write
gboolean disable-cookies Read / Write / Construct Only
gchar * url-format Read / Write
gchar * user-agent Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── RestProxy
        ├── FlickrProxy
        ├── LastfmProxy
        ├── OAuth2Proxy
        ╰── OAuthProxy

Description

Functions

rest_proxy_new ()

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.

Parameters

url_format

the endpoint URL

 

binding_required

whether the URL needs to be bound before calling

 

Returns

A new RestProxy.


rest_proxy_bind ()

gboolean
rest_proxy_bind (RestProxy *proxy,
                 ...);

rest_proxy_bind_valist ()

gboolean
rest_proxy_bind_valist (RestProxy *proxy,
                        va_list params);

rest_proxy_set_user_agent ()

void
rest_proxy_set_user_agent (RestProxy *proxy,
                           const char *user_agent);

rest_proxy_get_user_agent ()

const gchar *
rest_proxy_get_user_agent (RestProxy *proxy);

rest_proxy_new_call ()

RestProxyCall *
rest_proxy_new_call (RestProxy *proxy);

rest_proxy_simple_run ()

gboolean
rest_proxy_simple_run (RestProxy *proxy,
                       gchar **payload,
                       goffset *len,
                       GError **error,
                       ...);

rest_proxy_simple_run_valist ()

gboolean
rest_proxy_simple_run_valist (RestProxy *proxy,
                              gchar **payload,
                              goffset *len,
                              GError **error,
                              va_list params);

Types and Values

struct RestProxy

struct RestProxy;

RestProxy has no publicly available members.


struct RestProxyClass

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.

Members

bind_valist ()

Virtual function called to bind parameters.

 

new_call ()

Virtual function called to construct a new RestProxyCall.

 

simple_run_valist ()

Virtual function called when making a "simple" call.

 

REST_PROXY_ERROR

#define REST_PROXY_ERROR rest_proxy_error_quark ()

enum RestProxyError

Error domain used when returning errors from a RestProxy.

Members

REST_PROXY_ERROR_CANCELLED

   

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

   

REST_PROXY_ERROR_HTTP_MOVED_PERMANENTLY

   

REST_PROXY_ERROR_HTTP_FOUND

   

REST_PROXY_ERROR_HTTP_SEE_OTHER

   

REST_PROXY_ERROR_HTTP_NOT_MODIFIED

   

REST_PROXY_ERROR_HTTP_USE_PROXY

   

REST_PROXY_ERROR_HTTP_THREEOHSIX

   

REST_PROXY_ERROR_HTTP_TEMPORARY_REDIRECT

   

REST_PROXY_ERROR_HTTP_BAD_REQUEST

   

REST_PROXY_ERROR_HTTP_UNAUTHORIZED

   

REST_PROXY_ERROR_HTTP_FOUROHTWO

   

REST_PROXY_ERROR_HTTP_FORBIDDEN

   

REST_PROXY_ERROR_HTTP_NOT_FOUND

   

REST_PROXY_ERROR_HTTP_METHOD_NOT_ALLOWED

   

REST_PROXY_ERROR_HTTP_NOT_ACCEPTABLE

   

REST_PROXY_ERROR_HTTP_PROXY_AUTHENTICATION_REQUIRED

   

REST_PROXY_ERROR_HTTP_REQUEST_TIMEOUT

   

REST_PROXY_ERROR_HTTP_CONFLICT

   

REST_PROXY_ERROR_HTTP_GONE

   

REST_PROXY_ERROR_HTTP_LENGTH_REQUIRED

   

REST_PROXY_ERROR_HTTP_PRECONDITION_FAILED

   

REST_PROXY_ERROR_HTTP_REQUEST_ENTITY_TOO_LARGE

   

REST_PROXY_ERROR_HTTP_REQUEST_URI_TOO_LONG

   

REST_PROXY_ERROR_HTTP_UNSUPPORTED_MEDIA_TYPE

   

REST_PROXY_ERROR_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE

   

REST_PROXY_ERROR_HTTP_EXPECTATION_FAILED

   

REST_PROXY_ERROR_HTTP_INTERNAL_SERVER_ERROR

   

REST_PROXY_ERROR_HTTP_NOT_IMPLEMENTED

   

REST_PROXY_ERROR_HTTP_BAD_GATEWAY

   

REST_PROXY_ERROR_HTTP_SERVICE_UNAVAILABLE

   

REST_PROXY_ERROR_HTTP_GATEWAY_TIMEOUT

   

REST_PROXY_ERROR_HTTP_HTTP_VERSION_NOT_SUPPORTED

   

Property Details

The “binding-required” property

  “binding-required”         gboolean

Whether the URL format requires binding.

Flags: Read / Write

Default value: FALSE


The “disable-cookies” property

  “disable-cookies”          gboolean

Whether to disable cookie support.

Flags: Read / Write / Construct Only

Default value: FALSE


The “url-format” property

  “url-format”               gchar *

Format string for the RESTful url.

Flags: Read / Write

Default value: NULL


The “user-agent” property

  “user-agent”               gchar *

The User-Agent of the client.

Flags: Read / Write

Default value: NULL