|
mjsonrpc 1.0
A lightweight JSON-RPC 2.0 message parser and generator based on cJSON
|
Functions for creating JSON-RPC requests (client side) More...
Functions | |
| char * | mjrpc_request_str (const char *method, cJSON *params, cJSON *id) |
| Build a JSON-RPC request as a string. | |
| cJSON * | mjrpc_request_cjson (const char *method, cJSON *params, cJSON *id) |
| Build a JSON-RPC request as a cJSON object. | |
Functions for creating JSON-RPC requests (client side)
| cJSON * mjrpc_request_cjson | ( | const char * | method, |
| cJSON * | params, | ||
| cJSON * | id | ||
| ) |
Build a JSON-RPC request as a cJSON object.
Creates a JSON-RPC 2.0 request as a cJSON object with the specified method, parameters, and request ID. The parameters and ID will be owned by the request.
| method | Name of the RPC method to call (must not be NULL) |
| params | Parameters for the method (can be NULL, will be owned by request) |
| id | Request ID (can be NULL for notification, will be owned by request) |
| NULL | If an error occurred (params and id will still be released) |
| char * mjrpc_request_str | ( | const char * | method, |
| cJSON * | params, | ||
| cJSON * | id | ||
| ) |
Build a JSON-RPC request as a string.
Creates a JSON-RPC 2.0 request string with the specified method, parameters, and request ID. The parameters and ID will be released (freed) automatically.
| method | Name of the RPC method to call (must not be NULL) |
| params | Parameters for the method (can be NULL, will be released) |
| id | Request ID (can be NULL for notification, will be released) |
| NULL | If an error occurred (params and id will still be released) |