|
static const char * | DELETE (const char *collectionName, int id=-1) |
| Delete a collection or document. More...
|
|
static const char * | GET (const char *collectionName, int id) |
| Retrieve a document. More...
|
|
static const char * | GET (const char *collectionName, int id, char *blob, int blobSize, int documentBlobOffset=0, int documentBlobLength=0) |
| Retrieve a document. More...
|
|
static const char * | GET (const char *collectionName, const char *query=NULL) |
| Retrieve document identifiers. More...
|
|
static const char * | POST (const char *collectionName, const char *json=NULL) |
| Create a collection or document. More...
|
|
static const char * | POST (const char *collectionName, const char *json, const char *blob, int blobLength) |
| Create a collection or document. More...
|
|
static const char * | PUT (const char *collectionName, int id, const char *json) |
| Update a document. More...
|
|
static const char * | PUT (const char *collectionName, int id, const char *json, const char *blob, int blobLength) |
| Update a document. More...
|
|
The BRestful class.
- Note
- This class is currently a beta release; feedback about usage and suggestions for improvements are requested, and can be submitted at https://communities.actian.com/s/actian-zen.
The BRestful class is targeted at RESTful HTTP API developers. To that end a subset of the HTTP methods is supported. These methods are DELETE, GET, POST and PUT.
HTTP Method | BRestful Method | Description | Required Parameters | Optional Parameters | Returns |
DELETE | BRestful::DELETE | Delete a collection | Collection name | | Status |
DELETE | BRestful::DELETE | Delete a document | Collection name and document identifier | | Status |
GET | BRestful::GET | Query a collection | Collection name | Query | Status and array of document identifiers |
GET | BRestful::GET | Retrieve a document | Collection name and document identifier | User BLOB buffer | Status, document JSON, and optional document BLOB |
POST | BRestful::POST | Create a collection | Collection name | | Status |
POST | BRestful::POST | Create a document | Collection name and document JSON content | Document BLOB content | Status and document identifier |
PUT | BRestful::PUT | Update a document | Collection name and document identifier | Document JSON and BLOB content | Status |
All methods return JSON. In addition to the reserved JSON field names listed in BtrieveCollection the following reserved JSON field names are defined:
Field Name | User Settable | Type | Description |
_collectionName | no | string | The collection name. |
_ids | no | array of numbers | An array of document identifiers. |
_statusCode | no | number | The status code. |
_statusString | no | string | The status string. |
Non-user settable JSON field names are silently ignored by BRestful::GET, BRestful::POST, and BRestful::PUT. Use of reserved JSON field names other than those listed both above and in BtrieveCollection will generate an error.
- See also
- BtrieveCollection