str2json()
#
The function str2json
converts a legal JSON string into a JSON object. The input string must be a valid JSON array []
or object {}
.
Prototype
json_t *str2json(
const char *str,
BOOL verbose
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
A null-terminated string containing a valid JSON object or array. |
|
|
If |
Return Value
Returns a json_t *
representing the parsed JSON object. Returns NULL
if parsing fails.
Notes
[‘This function is an alias for string2json()
.’, ‘Use anystring2json()
if the input may contain other JSON types such as numbers or strings.’]
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples