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 ?
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. :)
{"Test": null}
. Just Tested. So now your .net server can easily convert it to its own null reference.
Jun 7, 2016 at 13:45