-2
我想從雲數據中獲取對字符串變量的響應。如何從雲到字符串獲取響應數據
ClientResource cr = new ClientResource("http://localhost:8888/users");
cr.setRequestEntityBuffering(true);
try {
try {
cr.get(MediaType.APPLICATION_JSON).write(System.out);
} catch (IOException e) {
e.printStackTrace();
}
} catch (ResourceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
我有響應,JSON在控制檯中,我想將其轉換爲字符串,則該GSON庫將是有益的?我還沒有使用它。我需要在代碼中進行哪些修改?任何人都可以幫助我。
是的,我已經得到了答案,反正謝謝很多蒂埃裏:) –