hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: write buffering
Date Thu, 16 Dec 2004 16:08:16 GMT
n Thu, 2004-12-16 at 00:57 +0200, Ilya Kharmatsky wrote:
Hi, All!
> I'm writing some layer above the http client.
> I need to provide to user following functionality:
>   1. Handle automatically all redirects / failures.

HttpClient automatically handles all types of redirects but one.
HttpClient is unable to automatically handle redirects of entity
enclosing methods (such as POST and PUT). See the HttpClient redirects
handling guide for detailed explanations:


>   2. Be able to buffer in memory the request (in post, put methods)
>   3. Max number of redirections.
> As I can understand from the code (I'm using version 3.0 beta1),
> if I won't set the content length, the request will be buffered, but
> I'll loose automatic redirections / failures handling. Am I right?
> What is a workaround?
Entity enclosing methods with unbuffered content cannot be retried for
apparent reasons. Since the redirects of entity enclosing methods are
not supported anyhow, the only problem is authentication failure and I/O
failure recovery. The former problem can be solved by using the so
called 'expect-continue' handshake. The latter problem can be solved by
recreating the request body input stream and retrying the request. 

> Max number of redirections - is http client supports this? I cannot
> find it. The circular references will (by default parameters) throw
> Exception, but if there is no such and still I wish to limit the
> number
> of redirections?
See 'http.protocol.max-redirects' parameter

Hope this helps 


> Thanks,
> Ilya Kharmatsky.

To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org

View raw message