Hi Stephen,
In regard to PostMethods, they cannot be redirected. Setting
followRedirects to true will have no effect.
As for the 100+ redirects it seems that there is a loop somewhere. If
you post a wire log
<http://jakarta.apache.org/commons/httpclient/logging.html> of the
first few redirects we should be able to figure out what's happening.
Mike
On Apr 6, 2004, at 7:31 PM, Stephen Charles Huey wrote:
> Please excuse my ignorance if I ask a really dumb question. I've been
> using HttpClient without trouble for a long time, and it accesses a
> secure site for me really well. However, something on the site seems
> to
> have changed, and now I'm experiencing an exception telling me the
> maximum number of redirects has been exceeded. The method
> getFollowRedirects() tells me that it's set to true, but I'm guessing
> that internally HttpClient or the HttpMethod sets that to false once a
> certain number have been followed/received. Is this correct?
>
> Every method I try to execute afterwards says getFollowRedirects is
> false
> even though I explicitly set it to true right before querying that. Or
> does the fact that they're all POST methods have anything to do with
> them
> being disabled from following redirects?
>
> Here's where my ignorance rears its head: when I'm using a web browser
> on the site and click on the link for the simple GET request, it loads
> up
> the next page very quickly, so I'm wondering if it's possible that
> there
> were really 100+ redirects in that time span, or if HttpClient is being
> confused somehow.
>
> My main question is, how do I get around this problem, or is there no
> way
> to do it with HttpClient? I'm getting this exception message on the
> simple GET request:
>
> Apr 6, 2004 6:25:58 PM org.apache.commons.httpclient.HttpMethodBase
> execute
> SEVERE: Narrowly avoided an infinite loop in execute
> org.apache.commons.httpclient.HttpRecoverableException: Maximum
> redirects
> (100) exceeded
> at
>
> org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.jav
> a:1111)
> at
>
> org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:
> 675)
> at
>
> org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:
> 529)
> at QuickWebImporter.importAll(QuickWebImporter.java:76)
> at QuickWebImporter.main(QuickWebImporter.java:148)
> getAddressBook follow redirects again: true
> postExportPage follow redirects: false
> Apr 6, 2004 6:25:58 PM org.apache.commons.httpclient.HttpMethodBase
> processRedirectResponse
> INFO: Redirect requested but followRedirects is disabled
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
|