Ortwin Gl�ck <ortwin.glueck 'at' nose.ch> writes:

> Hi Greg,
> 
> The redirect is completely handled inside HttpClient. You get the
> response code of the last request, which is 2xx normally. The only way
> to know if the request was redirected, is to compare the URI of the
> request after execution with the one before execution:
> 
> HttpMethod get = new GetMethod("....");
> URI uri = get.getURI();
> client.execute(get);
> boolean wasRedirected = ! method.getURI().equals(uri);

If I'm correct, this makes HttpClient users unable to be more
than "conditionally compliant" with the HTTP specifications. To
be fully compliant, one must (e.g. SHOULD is used in RFC) not
refer anymore to a permanently moved resource (301), which is not
the case with a temporarily moved resource (302), and there is no
way to distinguish between these two cases using your proposed
technique.

-- 
Guillaume Cottenceau

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

Reply via email to