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. > Ilya,
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: http://jakarta.apache.org/commons/httpclient/3.0/redirects.html > 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 http://jakarta.apache.org/commons/httpclient/3.0/preference-api.html Hope this helps Oleg > Thanks, > Ilya Kharmatsky. > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
