jsonObject.accumulate("status",null);
I want to pass null as a value in json service call i try ""
," "
, NULL
, nil
,"null"
but nothing helps
Could anyone have solution for this ?
Try using
JSONObject.NULL
instead of null, if you are using org.json.
Referenced from documentation.
edit
I tried, creating an json object with null as value, something like this.
JSONObject jsonObject = new JSONObject();
jsonObject.put("Test", JSONObject.NULL);
and the output generated on printing it was, {"Test": null}
So, I guess this will do the magic for you. :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With