/**
* 根据传入url请求,返回json字符串
* @param url
* @return
* @throws UnsupportedEncodingException
*/
public static String loadJSON(String url) throws UnsupportedEncodingException {
StringBuilder json = new StringBuilder();
try {
URL tempurl = new URL(url);
URLConnection conn = tempurl.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream(),"utf-8"));
String inputLine = null;
while ((inputLine = in.readLine()) != null) {
json.append(inputLine);
}
in.close();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return json.toString();
}