This topic describes the syntax, features, parameters, and return values of JSON functions. This topic also provides examples of these functions.
json_enc
The following table describes the details about this function.
Item | Description |
Syntax |
|
Description | Encodes a dictionary object into a JSON string. |
Parameters | d: the dictionary object that you want to encode. |
Return value | If the function succeeds, a JSON-encoded string is returned. Otherwise, |
Example |
|
json_dec
The following table describes the details about this function.
Item | Description |
Syntax |
|
Description | Decodes a JSON string into a dictionary. |
Parameters | s: the JSON string that you want to decode. |
Return value | If the function succeeds, a dictionary is returned. Otherwise, Note A numeric string such as "123" can also be decoded into a variable of the number type. If you want to perform operations on the returned dictionary, such as getting a value, use the type function to determine the type of the variable. |
Example |
|