String urlStr = URL + URLEncoder.encode(jsonStr, "UTF-8");
URL url = new URL(urlStr);
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
jsonResult = in.readLine();
in.close();
在我的jsonStr中,如果字段“文本”包含空格,则在输出中,经过Restful服务处理后,它在jsonResult中包含“ +”。例如:
Input:"好的 谢谢"
Output: “好的+谢谢”