This procedure adds JSON Object field into response.
Parameter | Type | Description | |
---|---|---|---|
element | 30A VARYING, VARSIZE | Mandatory | Name of element |
fieldName | 30A VARYING, VARSIZE | Mandatory | Field name |
obj_ptr | POINTER | Mandatory | Pointer to JSON Object |
The procedure returns pointer of field. If procedure can’t add field, then returns null.
Note: The JSON Object have to be created by JSON_new(); procedure. Then use: JSON_startNode, JSON_endNode, JSON_addStringPair, JSON_addNumericPair, etc….. By these functions You can create JSON Object into memory. Then this JSON object can be put into response. After field is added then JSON_destroy must be used to avoid memory leak.`
Examples:
respAddObjectField('data': 'objectData': %ADDR(xxObjData));