Many http server (probably most) don't implements the HEAD method. Even they do, it's not reliable. The only thing you can count on an http server is that it works with a browser. So if you do exactly the same thing as what a browser does, it should work. Try to turn on the log as suggested by otisg and see what was going on.
xiaowei -----Original Message----- From: Donald Ball [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 14, 2002 12:47 PM To: Jakarta Commons Developers List Subject: RE: bug in httpclient, can't talk to realaudio http server On Tue, 2002-05-14 at 15:22, Xiaowei Jiang wrote: > I'm not sure about the correct way to do this. For myself, I hacked the > source code in my local version to do this. But by reading the source code, > > http://cvs.apache.org/viewcvs/jakarta-commons/httpclient/src/java/org/apache > /commons/httpclient/log/LogSource.java?rev=1.8&content-type=text/vnd.viewcvs > -markup > > It will use log4j if it finds it in your classpath. Then just configure > log4j to enable the log for category "httpclient.wire". But I never had > enough patience to figure out where does log4j find its configuration file, > ... so I hacked :) Let me know if you figured this out. i'm afraid that i'm even more ignorant of the mysteries of configuring log4j than you. i've generally resort to System.err debugging. anyway, digging around in the real server's logs, i note that it doesn't log anything in the access log for these attempts. instead, it logs this helpful message in the error log: ***14-May-02 15:37:16.110 logplin(667): 2140: Illegal hello message : 18501 which implies that the request is something the server can't understand. then it hit me - i'm issuing a HEAD request to test for the existence of resources that i can't or don't want to try to parse. the real http server, bless its evil little heart, simply closes the connection for such requests: [balld@localhost tmp]$ telnet realaudio.webslingerz.com 8080 Trying 66.45.6.69... Connected to susan.webslingerZ.com (66.45.6.69). Escape character is '^]'. HEAD /ramgen/lingual/eyeprint.rm HTTP/1.0 Connection closed by foreign host. not even 501 or a 400 or a 403, any of which might have been appropriate. geez. so httpclient is arguably doing the right thing, and i'll have to catch this and retry with a GET. thanks for the debugging assistance. and i'm still happy to try to provide some docs if they'll actually end up in the repository. - donald -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
