In my Java project I am constantly getting a string input such as "{type=01010201, capacity=700, auth_method=01, auth_no=090713}"
When I am trying to parse this string like below, it seems to fail
JsonObject tot_payload = null;
try {
tot_payload = new JsonObject(obj.getString("data"));
} catch (Exception e) {
log.error("record in json parsing error");
}
I understand that this is due to the fact that I am missing the spaces for the string. My application receives a variety of different strings like this and I was wondering if there would be any efficient way of turning such string into a json object.
dataatrribute? As far as I see, your input hastype, capacity, auth_method, auth_no, but you're trying to fetch the key that is not inside this object.objvariable value