0
我有一個JSON字符串編碼URL編碼編碼我的字符串兩次
String strMappingList = [{"Id": "67","AccessType": "2"},{"Id": "1111","AccessType": "2"},{"Id": "1166","AccessType": "2"}]
當我沒有URL編碼它編碼strMappingList兩次
try {
String str = URLEncoder.encode(strMappingList, "utf-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
上面的代碼編碼方法編碼的字符串僅一次O/p爲%5B%7B%27Id%27%3A +%2767%27%2C%27AccessType%27%3A +%272% 27%7D%2C%7B%27Id%27%3A +%271111%27%2C%27AccessType%27%3A +%272%27%7D%2C%7B%27Id%27%3A +%271166%27%2C%27AccessType% 27%3A +%272%27%7D%5D –