How to pass null values in a JSON request
- Last Updated: January 29, 2025
- 1 minute read
- Corticon
- Documentation
Passing a null value to any Corticon Server using JSON payloads is accomplished by either:
- Omitting the JSON attribute inside the JSON object
- Including the attribute name in the JSON Object with a value of
JSONObject.NULL
JSON payloads with null values created by Rules
When Rules set a null value that propagates into the payload of a request, JSON treats the null as follows:
Assume that the incoming payload is...
Person
Age : 45
Name : Jack
... and that rule processing sets Age
to a JSONObject.NULL object.
If
JSONObject.toString() is called, the
output would look like this: Person
Age : null
Name : Jack