CouchdbResponse

CouchdbResponse

Synopsis

                    CouchdbResponse;
                    CouchdbResponseClass;
CouchdbResponse *   couchdb_response_new                (void);
const char *        couchdb_response_get_etag           (CouchdbResponse *self);
guint               couchdb_response_get_status_code    (CouchdbResponse *self);
const char *        couchdb_response_get_content_type   (CouchdbResponse *self);
gsize               couchdb_response_get_content_length (CouchdbResponse *self);
JsonObject *        couchdb_response_get_json_object    (CouchdbResponse *self);
GList *             couchdb_response_get_rows           (CouchdbResponse *self);
                    CouchdbResponsePrivate;

Description

Details

CouchdbResponse

typedef struct {
	GObject parent;
	CouchdbResponsePrivate *priv;
} CouchdbResponse;


CouchdbResponseClass

typedef struct {
	GObjectClass parent_class;
} CouchdbResponseClass;


couchdb_response_new ()

CouchdbResponse *   couchdb_response_new                (void);


couchdb_response_get_etag ()

const char *        couchdb_response_get_etag           (CouchdbResponse *self);

Returns the value of ETag header from the response. This header is set to the current revision of the document requested.

self :

A CouchdbResponse object

Returns :

A string containing the ETag header or NULL if there has been no ETag in response headers.

couchdb_response_get_status_code ()

guint               couchdb_response_get_status_code    (CouchdbResponse *self);

Returns the response status code

self :

A CouchdbResponse object

Returns :

status code of the response

couchdb_response_get_content_type ()

const char *        couchdb_response_get_content_type   (CouchdbResponse *self);

Returns the string containing content type of the response.

self :

A CouchdbResponse object

Returns :

Content-Type of the response or NULL if the header wasn't set

couchdb_response_get_content_length ()

gsize               couchdb_response_get_content_length (CouchdbResponse *self);

Returns content length of the CouchDB response.

self :

A CouchdbResponse object

Returns :

content length or 0 if response doesn't contain any body.

couchdb_response_get_json_object ()

JsonObject *        couchdb_response_get_json_object    (CouchdbResponse *self);

Returns a JsonObject containing the response from CouchDB server.

self :

A CouchdbResponse object

Returns :

A JsonObject containing response from the server. Object is owned by CouchdbResponse and should not be freed. [transfer none]

couchdb_response_get_rows ()

GList *             couchdb_response_get_rows           (CouchdbResponse *self);

Returns a list of JsonObject rows returned by the CouchDB server.

self :

A CouchdbResponse object

Returns :

A GList of JsonObject objects. Returned objects are owned by CouchdbResponse, GList should be freed by caller when no longer needed. [element-type Json.Object][transfer container]

CouchdbResponsePrivate

typedef struct _CouchdbResponsePrivate CouchdbResponsePrivate;