Thanks Roland, that's exactly the kind of advice I needed. (And thanks for
your patience with a newbie.)
I'll use HttpMethods in my app.
- Jeff
Roland Weber
<[EMAIL PROTECTED]
so.net> To
HttpClient User Discussion
08/23/2006 01:47 <[email protected]
PM >
cc
Please respond to Subject
"HttpClient User Re: Equivalent of
Discussion" setFollowRedirects(false) for
<httpclient-user@ HttpConnection
jakarta.apache.or
g>
Hello Jeff Lee,
> I'm writing an application that downloads files, and I need to disable
the
> automatic following of HTTP redirects.
> Does that mean that, to download my files, I have to use GetMethod
instead
> of HttpConnection.getResponseInputStream() ?
>
> More specifically:
>
> Class HttpMethodBase has a method named setFollowRedirects(boolean),
which
> can be used to "turn off" the automatic following of HTTP redirects.
>
> However, if I use HttpConnection.getResponseInputStream(), there doesn't
> appear to be a corresponding way to turn off automatic HTTP redirection.
>
> Or am I missing something?
You are missing that the redirect logic is not in the connection.
If you use HttpConnection directly, it is your responsibility to
handle redirects. In fact, it is your responsibility to handle everything.
I have no idea why you would try to do that in the first place.
Only if you execute HttpMethods through the HttpClient, you will have
automatic redirect handling. And in that case, you can set the flag in
the method to disable it.
hope that helps,
Roland
---------------------------------------------------------------------
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]