我从 php 主机收到 json 响应
{"uid":"0"}
我想从中检索 0(即 uid 值)
我尝试检索它..但有异常
这是我的代码..
HttpEntity entity = response.getEntity();
} catch(Exception e) {
System.out.println("Exception : " + e.getMessage());
}
finally {
if (conn != null) {
try {
conn.close ();
}
catch (Exception e) { e.printStackTrace(); }
}
}
//convert response to string
/*
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(is, "iso-8859-1"),8);
StringBuilder sb = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) {
sb.append(line+"\n");
}
is.close();
result = sb.toString();
} catch(Exception e) {
System.out.println("Exception : " + e.getMessage());
}
try
{
??????????????????????????
} catch(Exception e) { e.printStackTrace(); }