When I try to put "null"
string value to a JSONObject
using the API JSONObject.element(key, value)
, this API converts this "null"
string value to null
.
API used: net.sf.json.JSONObject, JAR version: json-lib-2.3-jdk15
JSONObject jObj = new JSONObject();
jObj.element("msg", null);
For the given code snippet, the output is
{"msg":null}
However, it should be
{"msg":"null"}