When converting HashMap
to JSONObject
, every /
in the string will replacing with this \/
why is like this?? any solution for this?
my string is
String sumValue= "mZftaLXj7UN19zxc/7n/UZdf....";
but i'm getting like this
D/b: getBody{"****":"*****","*****":"***",SUMHASH":"mZftaLXj7UN19zxc\/7n\/UZdf****"}
I'm tried like this
public byte[] getBody() {
String sumValue= "mZftaLXj7UN19zxc/7n/UZdf.....";
HashMap params2 = new HashMap();
params2.put("***", "*****");
params2.put("***", "*****");
params2.put("SUMHASH", sumValue);
Log.d(TAG, "getBody" + new JSONObject(params2));
try {
return new JSONObject(params2).toString().getBytes("utf-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
return null;
}}
Given below is the output while doing
System.out.println("getBody" + new JSONObject(params2));
No comments:
Post a Comment