/* * Main.java * */ package netukar.http.raw; import java.io.IOException; /** * * @author Radovan Netuka */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) throws IOException { String host = "www.google.cz"; StringBuilder b = new StringBuilder(); b.append("GET / HTTP/1.1").append("\r\n"); b.append("Host: ").append(host).append("\r\n"); b.append("Accept: text/html;charset=utf-8").append("\r\n"); b.append("\r\n"); try { RawHttpConnection connection = new RawHttpConnection(); String response = connection.sendRequest(host, b.toString()); System.out.println(response); } catch (IOException ex) { ex.printStackTrace(); } } }