URLConnection not working
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.
Re: URLConnection not working
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