Google カスタム検索エンジンを作成し、HTTP GET を使用してクエリを開始しました。現在、Google は結果を JSON 形式で返しています。この JSON 出力を人間が読める形式にフォーマットする方法を考えていました。
例えば:
Title: The matrix
htmlTitle: "The matrix.."
多くのフォーラムで XStream が推奨されているのを見てきました。しかし、どうすればこれを機能させることができるかわかりません。
誰かがこれで私を助けてくれませんか。
参考までに、ここに HTTP GET コードを示します。
public static void main(String[] args) throws IOException {
HttpGet httpget = new HttpGet("https://www.googleapis.com/customsearch/v1?key=AIzaSyBp_5Upf6h0QSXR8UveLs4_c6lAmGW_7B8&cx=014783642332862910131:opc1zgsvfhi&q=matrix&alt=json");
System.out.println(httpget.getURI());
ResponseHandler<String> responseHandler = new BasicResponseHandler();
HttpClient httpClient = new DefaultHttpClient();
String responseBody = httpClient.execute(httpget, responseHandler);
System.out.println(responseBody);