tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Honey George <honey_geo...@yahoo.com>
Subject Re: HttpUrlConnection.getInputStream() returns empty
Date Tue, 27 Jul 2004 12:41:55 GMT
Hi reynir,
  I have made the changes as per you suggestion and I
am getting the response code as 200. But still the
inputstream returns empty, is.available() returns 0
bytes.

thanks,
 - george
--- Reynir_Þór_Hübner <reynir@hugsmidjan.is> wrote: >
hi,
> you could maybe try somthing like the following :
> 
> try
> {
>    String str_url = "https://www.domain.com";
>    URL urlid = new URL(str_url);
>    HttpsURLConnection conn =
> (HttpsURLConnection)urlid.openConnection();
>    conn.setRequestMethod("GET");
>    conn.setDoOutput(false);
>    out.write("RESPONSECODE = " +
> conn.getResponseCode()+"\n<br>");
>    BufferedReader in1 = new BufferedReader(new 
> InputStreamReader(conn.getInputStream()));
>    String line;
>    while ((line = in1.readLine()) != null)
>       out.write(line +"\n");
> }
> catch (Exception e)
> {
>    e.printStackTrace(System.out);
> }
> 
> hope it helps
> -reynir
> 
> 



	
	
		
___________________________________________________________ALL-NEW Yahoo! Messenger - all
new features - even more fun!  http://www.allnewmessenger.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message