How to get HTTP version from Response Header using HttpURLConnection
807606Mar 20 2007 — edited Mar 21 2007For the response header, HTTP/1.1 200 OK, I wish to get the "HTTP/1.1"
portion, how should I do so if I am using HttpURLConnection?
URL url=new URL("http://lapdog.47ronin.com:8080/images/icons/Apple.gif");
URLConnection connection=url.openConnection();
HttpURLConnection httpConnection = (HttpURLConnection)connection;
httpConnection.setRequestMethod("GET");
httpConnection.connect();
System.out.println(httpConnection.getResponseCode());//getting 200 System.out.println(httpConnection.getResponseMessage());//getting OK
//How should I get HTTP version??