それで、私は小さなプログラムを作成し、それがpostメソッドをWebサイトに送信してから応答を出力しますが、Webブラウザーで応答を表示できますか?
HttpResponse response = client.execute(post);
BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
String line = "";
while ((line = rd.readLine()) != null) {
System.out.println(line);
if (line.startsWith("Auth=")) {
String key = line.substring(5);
// Do something with the key
}
}
} catch (IOException e) {
e.printStackTrace();
}
デバッガーでページ全体が印刷されますが、代わりにブラウザーで表示できますか?
私はapacheのHttpClientを使用しています。
どういうわけか応答をURIに変換してから使用することは可能ですか?java.awt.Desktop.getDesktop().browse(response);