Click to See Complete Forum and Search --> : URLConnection not working


Zulfi Khan
August 5th, 1999, 06:11 AM
Please see the following code & help me :

URL hp = new URL ("http://www.starwave.com/people/naughton/");
URLConnection hpCon = hp.openConnection ( );
int len = hpCon.getContentlength ( );
if (len > 0) {
System.out.println("Content-length: + len);
}
else {
System.out.print("No Content Available");
}

I am getting
"No Content Available"

Can somebody tell me what is the reason for this message ??

Zulfi.

unicman
August 5th, 1999, 08:33 AM
There may be one of the two reasons...

1. the url u r trying is redirecting
2. The server may be sending data in chunks. I don't know if the URLConnection class retrieves contents if sent in chunks.

- UnicMan
http://members.tripod.com/unicman