Hi there,

The host you are dealing with has HTTP spec compliance problems. The host returns body 
content in response to HEAD request even though it is not supposed to. Use the 
following option to enable non-compliant HEAD response body check:

        HttpClient httpclient = new HttpClient();
        HeadMethod httphead = new 
HeadMethod("http://www.ipswitch.com/cgi/download_eval.pl?product=main";);
        httphead.setBodyCheckTimeout(500); // Activate optional body check
        httpclient.executeMethod(httphead);
        System.out.println(httphead.getStatusLine().toString());
        httphead.releaseConnection(); 

That should help.

Cheers

Oleg

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 29, 2003 3:59 PM
To: [EMAIL PROTECTED]
Subject: HEAD request hangs


I noticed that invoking a HEAD request to the url 
http://www.ipswitch.com/cgi/download_eval.pl?product=main
results in a hang..
Instead, a GET request returns correctly.
I verified that the server supports  HEAD requests, and actually it does..

The chunk of code I used is straightforward:

String urlName = new String(http://www.ipswitch.com/
cgi/download_eval.pl?product=main);

HeadMethod head_method = newHeadMethod(urlName);
head_method.setFollowRedirects(true);
head_method.setRequestHeader("User-Agent","Mozilla/5.0 (X11; U; Linux 
i686; it-IT; rv:1.3) Gecko/20030312");
                
responseCode = client_head.executeMethod(head_method);


the last call hangs indefinitely..

What could it be?


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to